I need message to have a different layout in project, is it possible in rails to do something like this?
Class Messages::New < @project? ProjectLayout : NormalLayout end #i treid this, don't work, since @project has not been initiated.
thanks
You can only apply layouts at the Controller level:
class MessagesController < ApplicationController layout :project end
Layout method documentation has an example on how to do conditional layouts