Advertisement

05.03.2008 at 10:15AM PDT, ID: 23374013
[x]
Attachment Details

Rails: Ajax checkbox

Asked by renderbox in Ruby Scripting Language

Tags: Ruby

I am generating a list from a collection using partials.  In each row of the list I am using a checkbox which the user can use to set the "on-off" state of that item.  The intent is when the user clicks the checkbox an AJAX call is made to set that value in the Database.  I tried to use the "observe_field" but all I got was a JavaScript error:

Value 0 (result of expression this.callback) is not object.
http://localhost:3000/javascripts/prototype.js?1203866909 (line 2140)

Any thoughts as to what I am doing wrong?  Do I need to put the checkboxes within a form?

Thanks,
GrantStart Free Trial
1:
<%= observe_field("tag_id", :url => {:action => 'updateActive'}, :frequency => 0, :with => "'value='+ escape(value)") %>
[+][-]05.03.2008 at 10:20AM PDT, ID: 21493085

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.03.2008 at 11:23AM PDT, ID: 21493261

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.04.2008 at 04:56PM PDT, ID: 21497458

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.04.2008 at 06:36PM PDT, ID: 21497679

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Ruby Scripting Language
Tags: Ruby
Sign Up Now!
Solution Provided By: wesgarrison
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.05.2008 at 07:29AM PDT, ID: 21500259

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628