olivernn / poirot

mustaches in your rails
http://olivernn.github.com/poirot
108 stars 21 forks source link

Support partial `:locals` #1

Closed bugeats closed 13 years ago

bugeats commented 13 years ago

It appears that the handler ignores local variables passed to a partial.

bartiaco commented 13 years ago

True that.

olivernn commented 13 years ago

Sorry, totally missed this one when it was raised, will take a look at it over the weekend.

charlotte-miller commented 13 years ago

Related Pull Request https://github.com/olivernn/poirot/pull/2

olivernn commented 13 years ago

I have just pushed a new release which supports locals. Locals are available as variables within your templates and view classes.

<%= render :partial => "some partial", :locals => { :foo => "foo", :bar => "bar" } %>

Inside your template you can now just access foo and bar

<h1>{{foo}}</h1>

Let me know if you find any issues with this.