My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads

better_partials by railsjedi.com

Provides syntactic sugar for render :partial

script/plugin install http://betterpartials.googlecode.com/svn/trunk/better_partials

Blog Post: http://www.railsjedi.com/posts/22

Examples

Render a partial

  <%= partial "people/search_box" %>

Pass some parameters in

  <% form_for @person do |f| %>
    <%= partial "people/form", :f => f %>
  <% end %>

Pass in a collection

  <%= partial "people/person", :collection => @people %>

Or the terse way

  <%= partial @people %>

Passing in a block to your partial

  <% partial "people/box" do %>
    Inner connect goes here.. (gets called in your partial's yield statement)
  <% end %>

Special Partial Options

Certain options names have meaning You can't use these as local variables when using the partial helper (for obvious reasons). All other options are passed through to the :locals option.

  :collection
  :spacer_template
  :object
  :use_full_path
Powered by Google Project Hosting