You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it would be really nice to be able to do something like this from inside views:
class ContentSectionWidget < Erector::Widget
def content
div :class => 'content' do
# magic here
end
end
def header header_text
tab do
h1 header_text
end
end
def tab &block
span :class => 'tab', &block
end
def body
div :class => 'body', &block
end
end
# Haml
= ContentSectionWidget.new do |w|
= w.header "Blah blah"
%p Some haml here
= w.body do
%p Some more haml body here
We are slowly moving from haml to erector, but we don't want to make a new erector class for every single view in the system yet. Being able to do something like the above where we can interoperate with erector from inside haml (or erb) woud be useful.
I've tried to come up with a simple way to do this, but haven't been able to yet. Thoughts?
The text was updated successfully, but these errors were encountered:
it would be really nice to be able to do something like this from inside views:
We are slowly moving from haml to erector, but we don't want to make a new erector class for every single view in the system yet. Being able to do something like the above where we can interoperate with erector from inside haml (or erb) woud be useful.
I've tried to come up with a simple way to do this, but haven't been able to yet. Thoughts?
The text was updated successfully, but these errors were encountered: