Forum: Ruby is it a Ruby ? Rails ? or JS ? problem...

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
6b2144362fffd4f71cca755d4045846f?d=identicon&s=25 Josselin (Guest)
on 2007-02-07 14:26
(Received via mailing list)
In a Rails controller action, I am receiving a string parameter back
from an Ajax request

#using inline RJS (Remote JavaScript), I render html replacing a hidden
input field in a form
    render :update do |page|
      page.remove ('new_title')
      page.insert_html(:after, 'hidden_values', "<INPUT TYPE=HIDDEN
id='new_title' NAME='new_title' VALUE='#{params[:new_title]}' />")
      page.form.reset 'propform'

if there is no single quote in params[:new_title] = "John Doe is a
stupid and silly boy"
I get the full string as a value in the input field
if there is a single quote in params[:new_title]  = "John Doe's sister
is a nice beautiful girl"
I get only  ""John Doe"

where is the problem.. is theer anyway to avoid it ?


6b2144362fffd4f71cca755d4045846f?d=identicon&s=25 Josselin (Guest)
on 2007-02-07 14:50
(Received via mailing list)
On 2007-02-07 14:20:15 +0100, Josselin <> said:

>       page.form.reset 'propform'
> where is the problem.. is theer anyway to avoid it ?
> thanks
> joss

got it !  :    I must write :    VALUE=\"#{params[:new_title]}\"
This topic is locked and can not be replied to.