Closed fazibear closed 8 years ago
Here is what i wrote, creates div class/id and text in one sweep https://github.com/salama/salama-debugger/blob/master/lib/base/element_view.rb#L22
just to have a look @fazibear , if you want
Sure, but I want to avoid construction like this:
def render
div class: "#{'monday' unless Time.now.monday?}" do
text 'monday'
end
end
And your soulution don't resolve a problem. Anyway, there not much difference between class: "monday active"
and `class: ".monday.active". Better solution is:
def render
div.monday.active do
text 'monday'
end
end
And this is what I want to archive with opal-virtual-dom
gem in a future.
added class_names
helper
Add simple helper method to build class names from hash with boolean values.
For example: