Where is the value in the text field coming from?  If it's coming from
your app (e.g. from the database or from a user passing parameters),
then you can do this on the Rails side of things, and it seems most
likely that you want to set an instance variable in the controller
(e.g. @text_field_value = [value]), which you can then use in both
your link_to and text_field.  If you want the text field to
dynamically update as the value of the text field is changed, then you
should use Javascript, such as something along these lines:

<input type="text" onkeyup="$('link').innerHTML = this.value" />
<a href="preview..." id="link"> Default text </a>

Best of luck,

Greg

On Jan 27, 12:54 pm, Joe Peck <rails-mailing-l...@andreas-s.net>
wrote:
> FWIW, I'm opening "preview" in another window.
>
> For right now, I plan on passing the current value of the text_field by
> setting params[:body] equal to it, but that doesn't seem to be the best
> idea.  Is there a better way to pass the current value to the "preview"
> action?
> --
> 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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to