Step 1 - Download and install the latest Eclipse IDE (3.1)
Step 2 - Download and install Rails on your machine
Rather than reproducing this portion of the setup, I would recommend following any of the well documented tutorials on this page.
Step 3 - Install the Ruby Development Tools Plugin for Eclipse
This is a plugin for developing in Ruby. It includes a Ruby Editor, Test::Unit Integration, Inherited Eclipse Features, Outline Views, Debugger, and Regular Expressions. It is full featured.
In Eclipse:# Choose Help->Software Updates->Find and Install
# In the dialog choose "Search for new features to install" and push next
# Select "Add Update Site", enter an arbitrary name and the url http://rubyeclipse.sourceforge.net/nightlyBuild/updateSite/ (I recommend the Nightly Build since it has better support for Eclipse 3.1)
# Check RDT and push next
# Select the feature org.rubypeople.rdt and push next. RDT will be installed and be available after restart.
Be sure to configure the RDT Plugin in Eclipse after reboot (select Windows > Prefrences > Ruby (most importantly tell Eclipse where your local ruby installation lies - "Installed Interpreters" - Interpreter Name "Ruby 1.8.2" - Location "/usr/local/bin") and modify other settings as desired
Step 4 - Create a new Ruby Project in Eclipse (File > New > Other : Ruby > Ruby Project) with project name "Blog" (for this tutorial)
# make sure you are in the RDT perspective (Windows > Open Perspective > Other: Ruby)
Step 5 - Create a new Rails project from a command prompt (terminal window)
From the command line:
d'andrew% rails Blog
Step 6 - Import the newly created Rails Blog files/directory structure into your Eclipse Blog Project
From within Eclipse:
# right-mouse click on your Blog Project
# Select Import > File System
# Browse to your newly created Rails Blog folder and choose this folder
# Check the box next to the Blog Folder
# Under "Options" make sure "Create selected folder only" is checked (should be by default)
# Click finish
Step 7 - Run scripts from command line
Make sure that you are running the scripts from your eclipse workspace directory (when we imported the Rails Blog directory structure, eclipse copied it to your defined workspace)
From the command line ($PROJECT_ROOT):
d'andrew% ./script/server generate controller Blog
Step 8 - Refresh your Eclipse project (F5 for shortcut)
Step 9 and the rest - Happy coding
Essentially the rest of it is composed of running scripts from the command line (although I am trying to figure out how to do this from within Eclipse) and refreshing your Eclipse project each time, then editing the files you need to.
Some other tricks/helps:
# To show all files in your Eclipse folder (ruby files are only shown by default in RDT plugin)
In the "Ruby Resources" box, there is a little down arrow at the far right. Click on this and un-click the "Show Ruby files only" option.
# Other plugins that are nice to have
CssEditor - for editing css files
XmlBuddy for editing XHTML files, etc.
JavaScript Editor Plugin
Naturally this is just a basic hack. If anyone has any good ideas I am anxious to hear them. And for the brave soul who wants to create the ultimate Rails plugin -- Happy Hacking!!!