It can be quite annoying working on your Ruby on Rails project on your PC and having to upload the edited files to the host-server everytime you change something. It gets even harder if you work on different PCs or in a team.

As far as I am aware of, there are only two solutions to this problem:

1. Dreamweaver Extension

If you are a user of Dreamweaver, you could use the Dreamweaver RoR extension. the only known extension right now is RubyWeaver. Unfortunately it is absolutely impossible to find it on the web (been there, done that). But as I am a lucky one and am favored by Gods, I HAVE a copy (yeaahoooo!?) and put a mirror online. Download rubyweaver.mxp here.

Then, just use the Dreamweaver’s project functions to access your remote server and work on your files. (haven’t tried this method, yet. Comments welcome)

2. FTP Virtual Drive

You can use NetDrive software (windows only, macs and linuxes got a similar function, for sure :-) ) to create a “virtual drive” that automatically connects to your server’s FTP. Then, you just use it as a normal hard drive. And by editing the files with your favorite editor, they are automatically uploaded and saved on your server.

This method is my favorite as I can work on any computer that has NetDrive installed (I have a copy on my Memory Stick just in case ;-) ). As this software is also hard to find online I put a mirror on this website. Download NetDrive.exe (installer).

Warning! I wasn’t able to get RadRails to work with NetDrive (i.e. Adding a project located on the virtual dirve). Comments and suggestions are welcome. Currently I use other editors for this purpose.

Enjoy! :-)

To post code samples I installed iG:Syntax Hiliter v3.5 for wordpress, which supposedly supports ruby. Now let's try it out:

RUBY:
  1. def login
  2. case @request.method
  3. when :post
  4. if @session['user'] = User.authenticate(@params['user_login'], @params['user_password'])
  5.  
  6. flash['notice']  = "Login successful"
  7. redirect_back_or_default :controller => "moneyger", :action => "index"
  8. else
  9. @login    = @params['user_login']
  10. @message  = "Login unsuccessful"
  11. end
  12. end
  13. end

Excellent! ::-)

I am seriously considering adding few code samples to atrails with live demos. For this purpose I setup a new subdomain called samples.atrails.com which will run on a ruby server.

Following the Dreamhost wiki manual, my default host, I'll proceed with RoR installation on this subdomain. My PC at home has the default webrick server running, which comes with the RoR package. I don't know which one Dreamhost uses, but it doesn't matter right now. It's just a test server and performance is not a big deal here.

Alright. The subdomain is setup and running (and default category set up to samples.atrails.com/public as said in the wiki). Now we configure RoR server through the telnet account:

[server]$ rails samples.atrails.com
[server]$ cd samples.atrails.com
[server]$ chmod 755 public

Hmm. Now let's try if it worked...and... YUP! It did! Now the only thing left to do is to create a new test database for demo purposes.

The samples subdomain will have an index of all demos, which will run as separate project components.

Piece of cake! :-)


By label:

 

More

About

The "at rails dot com" is a fansite-weblog of a professional banker and amateur programmer/designer. It is a source of information, tools and tutorials that shall serve as a reminder for myself aswell as a valuable ruby on rails resource for everyone interested in that topic.