in the params hash
e.g.
text_field :foo, :bar == params[:foo][:bar]
On Jul 30, 10:02 am, Antonio Fernandes <rails-mailing-l...@andreas-
s.net> wrote:> Hello.
> Im new on rails, and i''m trying to make a page that will invoque a
> webservice.
> But since im new on rails, i''m trying to make a simple thing,
trying to
> pass the values of a form to a new page.
>
> I''ve got this form:
>
> <%= start_form_tag :action => "mostra", :id =>
@parametro %>
> <table>
> <tr><td>Tipo entidade</td>
> <td> <%= select( "pesquisa", "value", {
"Empresa" => "0", "Individual"
> => "1", "Desconhecido"=>"2"})
%></td></tr>
> <tr><td>Lingua</td>
> <td> <%= select :pesquisa, :language, @SiteLanguages,
> {:selected=>@selected_language} %></td></tr>
> <tr><td>Nome</td>
> <td><%= text_field :pesquisa, :nome, :maxLength => 70, :size
=> 70
> %></td></tr>
> <tr><td>NIF</td>
> <td><%= text_field :pesquisa, :nif, :maxLength=>9, :size=>9
> %></td></tr>
> <tr><td>Telefone</td>
> <td><%= text_field :pesquisa, :telefone, :maxLength => 15,
:size= =>15
> %></td></tr>
> <tr><td>Num. Coface</td>
> <td><%= text_field :pesquisa, :numCoface, :maxLength=>8,
:size=>8
> %></td></tr>
> <tr><td>Distrito</td>
> <td> <%= select :pesquisa, :distrito, @Distritos, {:selected=>
> @selected_distrito} %></td></tr>
> <tr><td>Concelho</td>
> <td><%= text_field :pesquisa, :concelho
%></td></tr>
> <tr><td>Codigo postal</td>
> <td><%= text_field :pesquisa, :codPostal, :maxLength=>8,
:size=>8
> %></td></tr>
> </table>
> <%= submit_tag ''Pesquisar'' %>
> <%= end_form_tag %>
>
> ANd this is my controler:
> class ClfController < ApplicationController
> def pesquisa
> @time = Time.now
>
> @SiteLanguages = [''en'', ''de'',
''fr'']
> @selected_language = ''en''
>
> @TipoEntidade = [''Empresa'',
''Individual'', ''Desconhecido'']
> @selected_tipoEntidade = ''Empresa''
>
> @Distritos = [''Aveiro'',''Beja'',
''Braga'', ''Braganca'', ''Castelo
> Branco'', ''Coimbra'', ''Évora'',
''Faro'', ''Guarda'',
''Leiria'', ''Lisboa'',
> ''Portalegre'' , ''Porto''
,''Santarem'' ,''Setubal'', ''Viana do
Castelo'', ''Vila
> Real'' , ''Viseu'', ''Angra do
Heroismo'', ''Horta'', ''Ponta
Delgada'',
> ''Funchal'']
> @selected_distrito = ''Braganca''
> end
>
> def mostra
>
> if request.post?
> @time = Time.now
> @parametro = 12
> #redirect_to :action => ''pesquisa''
> end
>
> #@items = Clf.find(pesquisa[nome])
> end
>
> Can anybody give me a help teling me how do i access in the controller
> to the values submited from the form.
>
> Thank you in advance,
> Capi
> --
> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---