Hi,
I have this code for a select box,
<%= select("plugin", "plugcats",
Plugcats.find_all.collect {|p| [
p.title, p.id ] }, { :include_blank => true }) %>
at the minute it extracts teh requried data, but submits the data as
params[''plugin''][''plugcats'']
how can I get it to submit it as
[''plugin''][''plugcat_id'']
thanks
--
Posted via http://www.ruby-forum.com/.
> how can I get it to submit it as [''plugin''][''plugcat_id''] > > thankshave you tried? <%= select("plugin", "plugcat_id", Plugcats.find_all.collect {|p| [ p.title, p.id ] }, { :include_blank => true }) %> -- Posted via http://www.ruby-forum.com/.
Ricardo Cabral wrote:> >> how can I get it to submit it as [''plugin''][''plugcat_id''] >> >> thanks > > have you tried? > <%= select("plugin", "plugcat_id", Plugcats.find_all.collect {|p| [ > p.title, p.id ] }, { :include_blank => true }) %>yeah, it just says undefined method -- Posted via http://www.ruby-forum.com/.
ss wrote:> Ricardo Cabral wrote: >> >>> how can I get it to submit it as [''plugin''][''plugcat_id''] >>> >>> thanks >> >> have you tried? >> <%= select("plugin", "plugcat_id", Plugcats.find_all.collect {|p| [ >> p.title, p.id ] }, { :include_blank => true }) %> > > yeah, it just says undefined methodshouldn''t Plugcats should be Plugcat? -- Posted via http://www.ruby-forum.com/.