ruby on rails - A Better Way To Render Complicated Flash Messages -


i have complex message show inside of flash message instead of having long string in controller, extracted partial. this:

flash[:success] = render(:partial => "complicated_message") … respond_to |format|   format.html   format.js end     

and normal view should rendered display flash. double render error, of course, since have "wasted" render on partial.

what better way this?

the answer, suggested @jdoe use render_to_string method instead.


Comments

Popular posts from this blog

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -