You dont need an Ajax call for this. RJS is enough.
in helper
def add_text_link(name)
link_to_function name do |page|
page[:text_area] = "This is new line"
end
end
in view
<%= add_text_link "Insert text into text area using JS" %>
On Mar 12, 7:18 pm, Sudhi Kulkarni <[email protected]>
wrote:
> Hi,
>
> I have a text area with id:"text_area" and in a link_to_remote tag I
> want to add content into the text area
>
> I tried (Syntax was correct though not the exact one as below)
>
> link_to_remote (update: "text_area",
> url : { action => "update_text"},
> position: bottom
> )
>
> The update_text action in the controller had
>
> render :text => "This is new line"
>
> THis does not work for text area, any help in the aspect would be good.
> If I have a div instead of text area it works but not for the text_area
> only.
>
> Thanks,
> Sudhindra
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---