Some useful notes on rails 3.1
Here I’ll try to list some useful things that I faced while developing a rails app as a noob.
Ok let’s say you detached your rails server to use the same terminal, but later you need to stop rails server, how? (surprise!)
The solution I found is simply finding Webrick server process id and kill it!
ps -ef | grep script/rails
now, kill the process id which is the first integer on the line
If you follow a “rails 3 tutorial” just like me, you probably have problems with ajax.
That’s because now jquery is default js framework in 3.1, not prototype. Prototype is a gem which you need to add your Gemfile to use that.
That’s why you should write partial templates in a .erb file not .rjs
An example change:
$(‘#item-holder’).html(“<%= j render @item %> “);
And lastly, If you installed MAMP and using MySql for your rails app, that’s a good chance that you will have issues while connecting the DB.
Below is my database.yml which works for me for a rails 3.1 app
That’s all for now, probably more rails posts will appear here..