Render A Partial To An Instance Variable
Join the DZone community and get the full member experience.Join For Free
Normally, if you call "render_partial" within a controller, nothing but the partial will be rendered. Occasionally, it is useful to render a partial to an instance variable as a string so that the view can still be rendered as normal, and the string can be passed in to the view.
add_variables_to_assigns @content_for_navbar = @template.render_partial 'layouts/public_navbar'