Hey

I'm trying to make a button_to_remote that also has an associated style.

It works fine as a button_to:
  <%= button_to "Paid", has_paid_event_booking_path(booking,
booking.event), :method => :post,  :style =>
"background:url(/images/money_add.png) left no-repeat; padding-left:
15px"  %>

but then when I change it to button_to_remote:
<%= button_to_remote "Paid", has_paid_event_booking_path(booking,
booking.event), :method => :post, :before => "Effect.Fade('not_paid_" +
booking.id.to_s + "')",:style => "background:url(/images/money_add.png)
left no-repeat; padding-left: 15px"  %>

with the above code, the :before is ignored

So, I change the path to a :url hash:
<%= button_to_remote "Paid", :url =>
has_paid_event_booking_path(booking, booking.event), :method => :post,
:before => "Effect.Fade('not_paid_" + booking.id.to_s + "')",:style =>
"background:url(/images/money_add.png) left no-repeat; padding-left:
15px"  %>

and then the :before works, but now the style is ignored!

How do I fix this?

Thanks in advance
Steve Brown
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to