Select in rails

hello everybody!!!

I want to pass the value of my select to another controller my code is
this

my user controller

def index
@users = User.find(:all)

my view index

broker

Seleccione un tipo de usuario

<%= select (:user , :user_id, @users.map{ |p| [p.name, p.id] }) %>

I don´t know do the submit with form??

any idea!!!
thanks

Leonard Y. wrote:

hello everybody!!!

I want to pass the value of my select to another controller my code is
this

my user controller

def index
@users = User.find(:all)

my view index

broker

Seleccione un tipo de usuario

<%= select (:user , :user_id, @users.map{ |p| [p.name, p.id] }) %>

I don´t know do the submit with form??

any idea!!!
thanks

to do a submit with a form would look like this:

<% form_tag :action => ‘method_nam’ do -%>

<%= submit_tag “Next”, :class => ‘inputsubmit’ %>

<% end -%>

if you want to call a different controller from the one you are
currently in do this:

<% form_tag :action => ‘method_nam’, :controller => ‘controller_name’ do
-%>

<%= submit_tag “Next”, :class => ‘inputsubmit’ %>

<% end -%>

A reference I use all the time is the rails api:
http://api.rubyonrails.org/

thanks very much, I´m going to doing

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs