logo       

InPlaceEditor trouble: msg#00064

lang.ruby.rails.spinoffs

Subject: InPlaceEditor trouble

Hi all

this is my first post to this list. Im am trying to use the InPlaceEditor, but I only manage to make it work in very simple case as in teh demo on the wiki. In my case I have a list of records ("books")  with different fields and each field has an InPlaceEditor. My problem is how to pass teh id of the record to the update action at the controller, I tried to define the InPlaceEditor with following callback (for manually building the argumetnd for the reqeust)

<script type="text/_javascript_">
      new Ajax.InPlaceEditor('title-<%= book.id -%>',
                             'update_book_title',
                             { callback: function(value) { return 'value=' + value + '&id=' + <%= book.id -%>}});
    </script>


I get  a _javascript_ error saying:

  ArgumentError in
  MyController#update_book_title
  wrong number of arguments (1 for 2)

the raw post look like this: value=3333&id=30&_=



Well, how can I pass the id of the record (or anythning else beside of the value) to the controller ?

regards
--
Roberto Saccon - http://rsaccon.com _______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@xxxxxxxxxxxxxxxx
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise