Forum: Ruby on Rails save value of text_field in the view

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2808d89ed3e9d70fe3bf2430ca89eb74?d=identicon&s=25 Maite .p (maite)
on 2009-01-25 20:16
hello everybody

How I save de value of text_fiel in the same view

<%= f.text_field :precio_compra, :size=> 10 %>

How do it???

thanks for all
A91bd6cef23eb3516245a092e196c4da?d=identicon&s=25 Maurício Linhares (mauricio)
on 2009-01-25 22:26
(Received via mailing list)
Could you please elaborate a little bit more?

What do you mean by "saving in the same view"?

-
Maurício Linhares
http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/
(en)



On Sun, Jan 25, 2009 at 4:16 PM, Maite Piedra
2808d89ed3e9d70fe3bf2430ca89eb74?d=identicon&s=25 Maite .p (maite)
on 2009-01-26 10:50
Maurício Linhares wrote:
> Could you please elaborate a little bit more?
>
> What do you mean by "saving in the same view"?

I want to catch the value of num_titulos for pass this value to action
comprueba, but I don´t know how I do it.

td><p><b>numero de titulos a comprar: </b><%= f.text_field
:num_titulos, :size=> 10 %> </p>

<p><b>Elija el precio al que compro: </b><%= f.text_field
:precio_compra, {:size=> 10, :onchange =>
"#{remote_function(:url=>{:controller=> "accions", :action=>
"comprueba"},:with =>"'valor='+ value")}"} %></p>
</td>

thanks for all
9a2a53db8e9b4476038c94a64b32833f?d=identicon&s=25 Ryan Bigg (ryan-bigg)
on 2009-01-26 13:40
(Received via mailing list)
If it is inside a form and that form points to the right action then
that field will be passed in via the params hash



On 26/01/2009, at 19:50, Maite Piedra <rails-mailing-list@andreas-
2808d89ed3e9d70fe3bf2430ca89eb74?d=identicon&s=25 Maite .p (maite)
on 2009-01-26 17:48
Ryan Bigg wrote:
> If it is inside a form and that form points to the right action then
> that field will be passed in via the params hash


ok it is inside a form but I want before to click on the bottom submit I
want to catch the value  to pass for :onchange

:onchange =>
"#{remote_function(:url=>{:controller=> "accions", :action=>
"comprueba"}

thanks again
2808d89ed3e9d70fe3bf2430ca89eb74?d=identicon&s=25 Maite .p (maite)
on 2009-01-28 19:25
Hello list I have the same problem yet

I dont catch value of text_field in the same erb.html file.

any idea???

thanks again.
This topic is locked and can not be replied to.