Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Replace HTML Problem

Reply
Thread Tools

Replace HTML Problem

 
 
Mke Van houten
Guest
Posts: n/a
 
      01-07-2009


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/.

 
Reply With Quote
 
 
 
 
Roger Pack
Guest
Posts: n/a
 
      01-08-2009

> 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_applican t.id}",
> @rotational_assignment_applicant.placement_priorit y
> 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-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace /n with a XHTML <br /> using string.replace Alun ASP .Net 3 02-18-2008 05:52 AM
Re: [Pyrex] pyrex functions to replace a method (Re: replace a method Greg Ewing Python 2 06-29-2006 05:25 PM
pyrex functions to replace a method (Re: replace a method in class:how?) Brian Blais Python 1 06-27-2006 12:13 PM
s/$match/$replace/ fails when $replace has backreferences anonyusenet@yahoo.com Perl Misc 3 09-12-2005 11:03 AM
help with string replace - for doing selective replace Prasad S Javascript 2 08-27-2004 03:22 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57