jcnetdev / better_partials

Rails plugin to make calling partials in views more fun.

This URL has Read+Write access

name age message
file .gitignore Fri Jul 04 13:02:51 -0700 2008 Transfer from SVN [jcnetdev]
file MIT-LICENSE Fri Jul 04 13:02:51 -0700 2008 Transfer from SVN [jcnetdev]
file README Loading commit data...
file Rakefile Fri Jul 04 13:02:51 -0700 2008 Transfer from SVN [jcnetdev]
file better_partials.gemspec
file init.rb
directory lib/
directory rails/
file uninstall.rb Fri Jul 04 13:02:51 -0700 2008 Transfer from SVN [jcnetdev]
README
better_partials
==============
Provides syntactic suger for render :partial


Example
=======
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
<%= partials @people %>

Also works, but not as nice reading
<%= partial @people %>

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


Special Partial Options pass through to render :partial
(all others are passed through to the :locals parameter)
=======
:collection,
:spacer_template,
:object, 
:use_full_path


Install into vendor/plugins
=======
script/plugin install git://github.com/jcnetdev/better_partials.git


Install via Gem
=======
If you're using Rails 2.1, you can use the plugin as a gem.

Add this to your environment.rb:

config.gem 'jcnetdev-better_partials', :version => '>= 1.0',
                                       :lib => 'better_partials',
                                       :source => 'http://gems.github.com'

Then install via: rake gems:install


Copyright (c) 2008 Jacques Crocker (www.railsjedi.com), released under the MIT license