Last Updated: February 25, 2016
·
378
· adone

HAML as variable

somewhere in view

%div
  = render_with_content :some_great_partial do
     %div= OMG

in helper

module SomeGreatHelper
  def render_with_content(partial, &block)
    render partial, content: capture_haml(&block)
  end
 end

and our some_great_partial

...

.content
  = content

...