$('text_area').value += ("\n Hello world" + name)

that should work or try..

$('text_area').value += ("\n Hello world" + "#{name} ")

But seriously.. keep trying different ways to get the result. you'll
hit it just by brute force.

On Mar 19, 3:48 pm, Sudhi Kulkarni <[email protected]>
wrote:
> Ram wrote:
> > My suggestion was just a try.Just try everything you can think of with
> > your code. its not going to affect anything else as far as i can see.
> > It would help if you tell us more about what the error was.
>
> > Take a look at prototype.js api docs. Wouldnt take more than a couple
> > of hours to go through the whole thing and it really helps.
> >www.prototypejs.org/api
>
> > Also look out for RJS tutorials. Railscasts episodes 43-45 are good
> > ones.www.railscasts.com/episodes/43
>
> > Here're a few RJS cheatsheets for quick reference
> >http://thebitt.com/dropbox/rails/rjs_cheatsheet.pdf,
> >http://slash7.com/assets/2006/10/8/RJS-Demistified_Amy-Hoy-slash7_1.pdf
>
> > Search the net thoroughly. More often than not, you can find a
> > solution or the question has already been asked on some forum.
> > And when you get errors that you cant resolve, post as much about them
> > as you can so that others can help you.
>
> > On Mar 18, 11:38 am, Sudhi Kulkarni <[email protected]>
>
> Hi Ram,
>
> The articles you sent and the previous posts helped me find this to get
> the stuff working but that leaves me with a new problem
>
> With the below RJS
>
> def add_text_link(name)
>     link_to_function name do |page|
> begin
>         page << <<-'end'
>   $('text_area').value += "\n Hello world"  ;
> end
> end
>
> I added above code in the RJS, this works but if I need to use the name
> parameter that is passed in how do I do it?
>
> I tried #{name} but no luck...
>
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to