开发者

Rails 3 - select tag - onchange

I am trying to do select box, where after select some option value will be this value send. Now I have following

<%= select_tag "action", options_for_select([ "1", "2", "3"]) , {}, 
             :onchange =>remote_function(:url => {:action => :index, :id => 0 }, 
             :with => "'action='+ +this.options[this.selectedIndex].value") -%>

and getting error wrong number of arguments (4 for 3). What is there wrong?

EDIT: Can anyone help me please with any function demo or example of form with select, t开发者_如何转开发hat works with :onchange event (e.g. what should be in controlller)? I still can't find the right way how to do. :/


Just remove the third argument {}.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜