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
...
Written by adone
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#