FANDOM


Partials can be partial layouts or views which can be output, a good use of this would be to split elements you might need to repeat into their own files.

Partial Views Edit

To render a partial view you would include something like

 <%= render "menu" %>

this would load the file _menu.html.erb from your app/views folder

Partial Layouts Edit

You can render partials with their own layout

 <%= render :partial => "link_area", :layout => "graybar" %>

The code above would render the partial from app/views/_link_area.html.erb using the layout from app/views/_graybar.html.erb (not the layouts folder)

External Links Edit

RoR Guide: Using Partials