Haml executes in the context of the scope object that's passed to
#render (or the object passed to #def_method). Any instance methods
defined on that object will be available within the template. For example:
class Foo
def render
"Render stuff here"
end
end
Haml::Engine.new("%p= render").render(Foo.new) #=> "<p>Render stuff
here</p>"
fred wrote:
> I am sorry for my lack of clearance, to Nathan and Hampton who made a
> great effort to reply.
>
> Anyway, I am looking into a way to smuggle in local method as what
> happened in Rails Haml Templating. How does it do the magic?
>
> e.g
>
> %p
> render :partial => 'plenty'
>
>
> In this case, render method is pointing to ActionView helper method.
>
> What I have tried to look at currently Haml::Filters and
> Haml::Helpers, haven't spotted any sample code to do so. Maybe I miss
> a thing.
>
>
> Best, F.
>
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---