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
Post a Comment