Helpers with blocks #63

Closed
Bastes opened this Issue Oct 5, 2012 · 1 comment

Comments

Projects
None yet
1 participant

Bastes commented Oct 5, 2012

Hi,

It've been trying to do something like this :

helpers do
  def embedding
    "<div>#{capture(yield)}</div>"
  end
end

And understood I was trying to do somethings rails-y when rails wasn't there.

Still, it would be really awesome to be able to do something like that to dry up all those messy repetitions in our e-mailings....

How do you think we could go about implementing it ?

Bastes commented Jan 29, 2013

Found out it works with the proper syntax using haml. Sorry for the noise.

For those that would like to do it:

helpers do
  def embedding &block
    "<div>#{capture_haml(&block)}</div>"
  end
end

@Bastes Bastes closed this Jan 29, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment