An attribute hash method would work, because it doesn't put a bracket in
the value until after it's parsed.
- Nathan
s.ross wrote:
> Thanks for the explanation. I have a dirt-simple workaround: Put the
> tag on one line and the ruby on the second. Here's what I did:
>
> %td{:class => @row_class}
> = check_box_tag :approved, 1, post_list_row.approved, {:onclick
> => "new Ajax.Request('#{url_for(:controller => 'posts', :action =>
> 'toggle_approved', :id => post_list_row[:id])}')"}
>
> Sill not the most delightful looking code but it runs :)
>
> Would attribute hashes work here? I.e.:
>
> %td{:class => @row_class}= check_box_tag :approved, 1,
> post_list_row.approved, ajax_toggle_code(post_list_row[:id])
>
> -- and --
>
> def ajax_toggle_code(row_id)
> {:onclick => "new Ajax.Request('#{url_for(:controller =>
> 'posts', :action => 'toggle_approved', :id => row_id)}')"}
> end
>
> What do you think?
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---