Render partial from a controller?

Try adding something like this to your application controller (this code is from authlogic gem): def store_location session:return_to = request. Request_uri end def redirect_back_or_default(default) redirect_to(session:return_to || default) session:return_to = nil end Then, in the controller that renders the 3 partials, call store_location Then, in the controller that creates the forum post, call redirect_back_or_default Hope this helps, - Dave.

Try adding something like this to your application controller (this code is from authlogic gem): def store_location session:return_to = request. Request_uri end def redirect_back_or_default(default) redirect_to(session:return_to || default) session:return_to = nil end Then, in the controller that renders the 3 partials, call store_location. Then, in the controller that creates the forum post, call redirect_back_or_default.

Hope this helps, - Dave.

Tnx, I'm going to try, does the parameter request. Request_uri store the partials too or just the url? – Joe Mar 6 at 14:52.

I have a page composed by several partials (3). One of them is a forum and when a user submit that forum, rails calls a create of a controller. After the object is created, I have to render the same page.

How is possible from the controller to recall directly the page with the partials already embedded? Is it possible to specify manually the partial I want in the controller (I don't care if I violate the MVC paradigm).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions