Rails 3.0.x and CKEditor

Hi coders!

Have you used ckeditor before? IMO, it’s a great tool for WYSIWYG editor. It provides you with complete features that are needed to write. Actually, install it in your web application is easy, but for some features you need to create another script. This what I’m going to share you about. How to install ckeditor in your Rails 3 application.

When I tried this for the first time, I use this page as my reference. Now in this post, I may repeat the steps but I also want to include a step which is not mentioned on that page. Well, let’s begin :

  1. Add this code in your Gemfile : gem 'ckeditor', '3.4.2.pre', then run bundle install
  2. Run this command : rails generate ckeditor:base. This will generate all ckeditor files in your rails project.
  3. Next step is preparing for migration. I use paperclip as my attachment plugin, so you should run this command : rails generate ckeditor:migration Continue reading “Rails 3.0.x and CKEditor”

Set Up Ruby on Rails at Linux Ubuntu Using RVM

I’ve been telling you a lot about Ruby on Rails but have I told you about how to set it up on your machine? Not at all. This is my chance to share my experience to you, but this time I’ll tell you about how to set it up on Ubuntu 10.04 (Lucid Lynx) or Ubuntu 11.04 (Natty Narwhal).  The setup on these two OS is similar, so you don’t have to be confused about the version difference of Ubuntu. Now, let’s get into the point, these were the steps that I did :

  1. Update the packaging tool repository (apt) just to make every download fast. You can do it by changing the file in /etc/apt/source.list
  2. Please install some initial package that are needed for some action, by running this command :
    sudo apt-get install build-essential openssl libreadline5 libreadline-dev git-core curl zlib1g zlib1g-dev
  3. Now let’s install RVM, by running this command :
    bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
  4. Go to your home directory (cd ~) and open up file .bashrc by running : vim .bashrc
    Continue reading “Set Up Ruby on Rails at Linux Ubuntu Using RVM”