Hello,
Im trying to understand how this helper method works:
def hidden_div_if(condition, attributes = {})
if condition
attributes[“style”] = “display: none”
end
attrs = tag_options(attributes.stringify_keys)
“<div #{attrs}>”
end
This is how they are calling it:
<%= hidden_div_if(@cart.items.empty?, :id => “cart”) %>
Specifically, I need to know if the :id => “cart” is passed on to attrs
with the style attribute…
And also, what does the tag_options(attributes.stringify_keys) do?
Thanks in advance!