In my website, a user can create a new post from any page. I’m unsure where to put the
@var = Model.new
though, since it doesn’t correspond to a specific controller. What’s the best practice for this situation? Would I want to to create it in the application controller? I figure I shouldn’t initialize it in the view itself.
Yes, you would create a
before_filterin yourApplicationControllerwhich will initialize@varas is necessary.