开发者

select tag not honoring name field - RoR

Do you have any idea why the name (="language") here is not being honored? I expect it to be in the search query.. but instead it spits out somethin开发者_运维百科g ugly like "company%5Blanguage%=".

<%=select( :company,:language,{'Italian' => 'Italian', 'English' => 'English','Italian and English' => 'Italian and English'},{:name => "language", :prompt=>true} )

I have tried to take it out of the brackets by the way.. no luck.

Thanks!


Ah interesting. In case this will help someone, here is my solution

select( :company,:language,{'Italian' => 'Italian',..},
{:name => "language", :prompt=>true},{:name => 
"language"} 

The reason is that the form of the select tag is

select(object, method, choices, options = {}, html_options = {})

and you need to make sure the :name is set in html_options.

Thanks!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜