these days i am having a lot of fun with Ruby on Rails. it seems to be like an open ground with lot of handful tools, now come up with ideas and build them up.
handful ruby based tools really helping me to let my smile back. anyway, while i was writing code on rails i am feeling something can be better practice something is not good. from now on, i will try to put them over the my blog.
their is method called “layout” which is used to define the based layout for the controller. this can be used from ApplicationController and other domain specific controller for example : “UserController”.
my team and me was used to define layout over the domain specific controller, but i belief, as we are repeating same “layout ‘template1′” code over and over, it must be better to keep inside the ApplicationController, as because all domain specific controllers are extending application controller, more over it is easy to change.
you may get a question about ajax based response, the better answer is, use render .., layout => false, that will get rid of base layout.