Even more maddening - i decided to try to do it with a button_to_remote 
instead:

 <%=  button_to_remote "Mark as not paid", :url => 
music_service_school_subscriber_path(@music_service, subscriber, 
:school_subscriber => {:paid => 0}), :method => :put, :failure => 
"alert('Sorry there was an error updating this subscriber')" %>

This generated the following, on the page (i added whitespace to make it 
more readable), which works, and appears to be exactly the same as i had 
when i hand-wrote the js!  wtf?  how come the code below works and the 
code above doesn't?

<input onclick="jQuery.ajax({
    async:true,
    dataType:'script',
    error:function(request){
      alert('Sorry, there was an error updating this subscriber')
    },
    type:'put',
    url:'/music_service/4/school_subscribers/368?school_subscriber%5Bpaid%5D=0'
  });"
type="button" value="Mark as not paid" />
-- 
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