I am using the in_place_editor_field method with scriptaculous and I am
receiving the rjs code instead of the value that was just updated.
The following is the code snippet from my view:
<%= in_place_editor_field('rotational_assignment_appli cant',
'placement_priority', {:id =>
"in_place_editor_#{rotational_assignment_applicant .id}"}, :script=>true)
%>
The following is the code snippet from my controller:
def set_rotational_assignment_applicant_placement_prio rity
@rotational_assignment_applicant =
RotationalAssignmentApplicant.find_by_id(params[:id])
@old_value = @rotational_assignment_applicant.placement_priorit y
@rotational_assignment_applicant.placement_priorit y = params[:value]
@rotational_assignment_applicant.placement_priorit y = @old_value
unless @rotational_assignment_applicant.save
render :update do |page|
page.replace_html
"in_place_editor_#{@rotational_assignment_applican t.id}",
@rotational_assignment_applicant.placement_priorit y
end
end
The placement_prioirty value is updated in the database correctly, but I
receive the following html code in the placement_priority text field:
ry { Element.update("in_place_editor_62", "3"); } catch (e) { alert('RJS
error:\n\n' + e.toString());
alert('Element.update(\"in_place_editor_62\", \"3\");'); throw e }
Any ideas what might be causing this issue? Thank you in advance for
all your help.
--
Posted via
http://www.ruby-forum.com/.