I have the piece of code where I am trying to use a variable for a class name in HAML. Here it is:
- data_table(@installation_requests, nil, {:placeholder => ''}) do |installation_request, css_class|
%tr{:class => css_class}
I can't see anything wrong with it, RubyMine IDE doesn't pick an error either, it thinks that it is legitimate use of the variable. I'm getting the following error:
odd number of arguments for Hash
Can anyone point me to what's wrong with the code above?
What if you try:
- data_table(@installation_requests, nil, {:placeholder => ''}) do |installation_request, css_class|
%tr{:class => "#{css_class}"}
or if you are saving your views as view.html.haml:
- data_table(@installation_requests, nil, {:placeholder => ''}) do |installation_request, css_class|
<tr class="#{css_class}">
....stuff....
</tr>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With