Accessing values of the form


#1

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 %>

Tipo entidade <%= select( "pesquisa", "value", { "Empresa" => "0", "Individual" => "1", "Desconhecido"=>"2"}) %>
Lingua <%= select :pesquisa, :language, @SiteLanguages, {:selected=>@selected_language} %>
Nome <%= text_field :pesquisa, :nome, :maxLength => 70, :size => 70 %>
NIF <%= text_field :pesquisa, :nif, :maxLength=>9, :size=>9 %>
Telefone <%= text_field :pesquisa, :telefone, :maxLength => 15, :size= =>15 %>
Num. Coface <%= text_field :pesquisa, :numCoface, :maxLength=>8, :size=>8 %>
Distrito <%= select :pesquisa, :distrito, @Distritos, {:selected=> @selected_distrito} %>
Concelho <%= text_field :pesquisa, :concelho %>
Codigo postal <%= text_field :pesquisa, :codPostal, :maxLength=>8, :size=>8 %>
<%= 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


#2

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-