n8 / multi_fetch_fragments

Multi-fetch Fragments makes rendering and caching a collection of template partials easier and faster.
http://ninjasandrobots.com/rails-faster-partial-rendering-and-caching
MIT License
539 stars 63 forks source link

Support short-hand partial rendering syntax #14

Closed swalkinshaw closed 11 years ago

swalkinshaw commented 11 years ago

This PR updates a few things, but mainly adds support for short-hand partial rendering.

Before, only the following syntax was supported:

<%= render partial: 'item', collection: @items, cache: true %>

Now, this is also supported:

<%= render @items, cache: true %>

Few other minor changes:

Let me know if you want any of these extra commits removed.

swalkinshaw commented 11 years ago

Just noticed there's another PR open (#13) that has some big changes. If you were going to merge both these in, I'd suggest mine first since it would be a lot easier.

ryansch commented 11 years ago

This is very useful.

n8 commented 11 years ago

@swalkinshaw Sorry, can you update the Readme in this pull request so it merges cleanly. I inadvertently merged in another pull request that also added some changes to the Readme for highlighting.

swalkinshaw commented 11 years ago

No problem. That highlighting fix was actually better since it used erb instead of ruby so I've updated and rebased mine to use that.