Filters are, at the moment, all evaluated at precompile-time, rather 
than render-time. This means that there's no way to get a reference to 
the view object that has helpers defined, nor to take arguments from the 
template. We plan to add this ability at some point.

s.ross wrote:
> I created a Rails form builder that creates lots o' two-column  
> tabular forms. Occasionally, I need to intersperse textual  
> instructions and it comes out looking awful in my Haml. What I did  
> was create a filter called span_row, and I'd like some comment on it.
>
> Usage:
>
> Assuming you have a tabular_form_for kinda helper (see Rails Recipes)  
> that generates one of these tables, the usage is like so:
>
> - tabular_form_for(@person) do |f|
>    = render :partial => 'form', :locals => {:f => f}
>    :span_row
>      When you click "signup," you will be taken to a page where you
>      can enter your credit card information. Please follow the
>      instructions there carefully.
>    = f.submit "Signup"
>
> The code for the helper is at:
>
> http://pastie.caboo.se/130587
>
> Issues:
>
> - I couldn't use the Haml::Helpers.open and .puts so indentation  
> doesn't exist. Huh?
> - I'd like to use an optional argument to the filter for columns, but  
> don't know exactly how to pass that. Suggestions?
>
> Thanks
>
> >
>
>   


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to