views:

36

answers:

1

Hello,

I have a form that has two field (time_selects), the idea is that the user can select the beginning of a call and end time of the call.

I've setup a observe field and works fine:

  <%= observe_field "llamada_inicio_4i", :update => "total", :with => "llamada_inicio_4i",
  :url => { :controller => "llamadas", :action => "time_tracker"}%>

Sends the value out:

Processing LlamadasController#time_tracker (for 127.0.0.1 at 2010-04-22 17:48:41) [POST] Parameters:"llamada_inicio_4i"=>"23",authenticity_token"=>"+D+yPSVue6yQNfPMuVLkrJn7B9tP6z5S1icKpPFTiso="} Rendering template within layouts/llamadas Rendering llamadas/time_tracker Completed in 5ms (View: 3, DB: 0) | 200 OK [http://0.0.0.0/llamadas /time_tracker]

How can i catch this value Parameters:"llamada_inicio_4i"=>"23"

+1  A: 

params[:llamada_inicio_4i]

in your controller

ohho
Would this function be enough to get the value? def time_tracker @inicio = params[:llamada_inicio_4i].to_i return :layout => false end
ZeroSoul13