I''d been using an old version of the helper. I downloaded the current
version of in_place_editor_field plugin and passed the option:
<%= in_place_editor_field .., .., :script => true %>
Works fine now. Cheers.
On Mar 6, 3:41 pm, keeny <m...-p+/i8dfuZsj10XsdtD+oqA@public.gmane.org>
wrote:> Hi all,
>
> I''ve had a read thru similar topics on the list but am still
> confused...
>
> I want an in place editor to call an action that does some rjs, not
> just return a text string.
>
> Normally the action would do something like:
>
> def edit
> # model.update(params[:value]
> render :text => params[:value]
> end
>
> But I want to do more stuff:
>
> def edit
> # model.update(params[:value]
> render :action => ''edit.rjs''
> end
>
> What options do I need to use in the view to evaluate the javascript
> returned? At the moment the javascript is just being displayed in the
> field as a string.
>
> I have hacked together the following, but is there a cleaner ''more
> rails'' way to do this?
>
> <%= in_place_editor @model.id, :url => {:action =>
''edit'', :id =>
> @model.id},
> :complete => "function(transport, element){
> // Id rather use rjs to do my javascript than have it in
the view
> like this.
> $
>
(''another_element_that_i_want_to_update'').update(transport.responseText);
> }" %>
>
> Any advice greatly appreciated,
>
> Barry.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---