It's not a huge deal for me. I was playing around with adding block
support to link_to. For example

link_to user do
  ...
end

I implemented this with capture:

def link_to_with_block(*args, &block)
  link_to_without_block(block_given? ? capture(&block) : args.shift,
*args)
end

alias_method_chain :link_to, :block

On May 11, 5:33 pm, Nathan Weizenbaum <[EMAIL PROTECTED]> wrote:
> So what you're saying is that you'd like
>
>   capture { "foo" }
>
> to return "foo" in a helper? I'm not sure why this is useful, and I
> dislike using eval to determine the enclosing scope, but I suppose it's
> important to keep compatibility with Rails. I've pushed a compatibility
> patch to git.
>
> - Nathan
>
> matthuhiggins wrote:
> > On EdgeRails and Git Haml, capture_with_haml always calls
> > capture_haml_with_buffer. The problem with this is that if a helper
> > method that uses capture is called from a haml template, nothing gets
> > captured.
>
> > In Rails ActionView::Helpers::CaptureHelper.capture, the code detects
> > whether it is running inside of a template or a helper. If called
> > inside a helper, it simply returns 'block.call(*args)', because we
> > just want the string.
>
> > If Haml::Helpers.is_haml? determined if it is inside of a Helper, I
> > think the problem would be fixed.
--~--~---------~--~----~------------~-------~--~----~
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