Search Results into new table

#Search stock view
<%form_tag(:action=>:search_stock) do%>
<%=submit_tag('Search")%>
<%end%>

#Search Stock Controller
def search_stock
@stocks = Stock.find_by_something()
render action=>:result_page
end

#Result Page
<%form_tag(:action=>:add_to_my_stocks) do %>
  <%@stocks.each do |stock|%>
     #Create set of checkbox and use stock_id as id
<%end%>
<%end%>

Nat wrote:

#Search stock view
<%form_tag(:action=>:search_stock) do%>
<%=submit_tag('Search")%>
<%end%>

#Search Stock Controller
def search_stock
@stocks = Stock.find_by_something()
render action=>:result_page
end

#Result Page
<%form_tag(:action=>:add_to_my_stocks) do %>
  <%@stocks.each do |stock|%>
     #Create set of checkbox and use stock_id as id
<%end%>
<%end%>

On Mar 18, 1:06�pm, Nick Hoyle <rails-mailing-l...@andreas-s.net>

Thanks for quick response

How exactly do you do a checkbox with an id?

<%= form.check_box :stock_id %>?

Hi all now i am doing with advanced search by using checkboxs and redio button for each items

for example :

<% form_for

:tblpss_description_record, @tblpss_description_record, :url=>{ :action=>‘view_detail_job_setup’ }, :html=>{ :id=>‘frm_view_setup’, :name=>‘frm_view_setup’, :method => :get} do |f|%>
<input

type=“checkbox” name=“elementprovince” value=“ALL” id=“optPROVINCE” onclick=“changeBoxesProvince(1)”>ALL

PHNOM PENH

BANTEAY MEANCHEY

BATTAMBANG

KAMPONG CHAM

KAMPONG CHHNANG

KAMPONG SPEU

KAMPONG THOM

KAMPOT

KANDAL

KEP VILLE

KOH KONG

KRATIE

MONDOL KIRI

ODORMEANCHEY

PAILIN

PREAH VIHEAR

PREY VENG

PURSAT

RATTANAKIRI

SIEM REAP

SIHANOUK VILLE

STUNG TRENG

SVAY RIENG

TAKEO

<% end %>

In this case i can search by each item or all item in form. I hope that all member in rubyonrails-talk will help me to solve this problem for me.

thank in advance!