Skip to content

Conversation

@swalkinshaw
Copy link
Contributor

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:

  • Changed is_a?(Proc) to respond_to?(:call) for a bit more flexibility.
  • Enabled using cache: false for easy collection caching toggling.
  • Removed some trailing whitespace.
  • Added ruby syntax highlighting to docs.

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

@swalkinshaw
Copy link
Contributor Author

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
Copy link

ryansch commented Mar 19, 2013

This is very useful.

@n8
Copy link
Owner

n8 commented Mar 23, 2013

@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.

Before: required syntax for rendering was:
`render partial: 'partial_name', collection: @collection, cache: true`

After: `render @collection, cache: true` works as well.

`cache: false` also disables caching as well now.
@swalkinshaw
Copy link
Contributor Author

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.

n8 pushed a commit that referenced this pull request Mar 24, 2013
Support short-hand partial rendering syntax
@n8 n8 merged commit 8e96ed3 into n8:master Mar 24, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants