[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Replace HTML Problem

Mke Van houten

1/7/2009 3:18:00 PM



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_applicant',
'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_priority
@rotational_assignment_applicant =
RotationalAssignmentApplicant.find_by_id(params[:id])
@old_value = @rotational_assignment_applicant.placement_priority
@rotational_assignment_applicant.placement_priority = params[:value]
@rotational_assignment_applicant.placement_priority = @old_value
unless @rotational_assignment_applicant.save

render :update do |page|
page.replace_html
"in_place_editor_#{@rotational_assignment_applicant.id}",
@rotational_assignment_applicant.placement_priority
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-....

1 Answer

Roger Pack

1/8/2009 6:37:00 AM

0


> 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.
> render :update do |page|
> page.replace_html
> "in_place_editor_#{@rotational_assignment_applicant.id}",
> @rotational_assignment_applicant.placement_priority
> end
> end

Not quite sure [might want to ask in rails group] but my first suspect
would be that replace_html call--what does it do, etc.
-=r
--
Posted via http://www.ruby-....