Rails Default Layout
Posted on February 15, 2009, under Rails.
As we all know, for any controller, by default rails looks the controller name .rthml files and if it doesn’t exists then it looks application.rhtml.
Since my site is very simple, I don’t have many layouts and just one layout and so i stored the layout file in app/views/layouts/application.html.erb and i removed all other layout files so that by default it will read application.html.erb.
Hope this helps somebody!
Pads
Rails with mysql database
As we all knew, recent rails version 2.2.2 supports sqllite3 as a default database and when you create a new app the “database.yml” would have been configured with sqllite3.
As I am used to mysql so much, I am not prepared to migrate to sqllite and still preferred to have mysql as the default database and to do this, you need to specify another parameter -d to the rails. Here a example
1 | $ rails <appname> -d mysql |
This would create a new app with mysql as its database.
Hope this helps!

