Monday, July 20, 2009

#{rails}

Well Strike me down and call me a noob
in a haml file:
:javascript
$(function(){$("#div_id_#{my_rails_object.id}").somefunc()});

Wow, the above works!

Monday, July 6, 2009

installing rails on ubuntu

After installing rubygems I ran
sudo gem install rails
- as per the instructions on the rails site.

However 'rails my_project' did not run, computer said 'no', well more specifically that rails was not installed and helpfully suggested 'sudo apt-get install rails'. I told it that I did not want to do that and edited etc/profile, adding the following line after the first set of comments:
PATH=$PATH:/var/lib/gems/1.8/bin
'rails my_project' now works.

rake still fails and in order to fix that the gem 'sqlite3-ruby' must be installed
sudo gem install sqlite3-ruby
That may grumble at first => 'checking for sqlite3.h... no'
In which case it needs a lib to be installed:
sudo apt-get install libsqlite3-dev