在我看来,我有以下代码:
<%= form_for :command_selected, :method => "get", :url => {:action => "command_domain_selected"} do |f| %>
<a> <%= link_to "Make Deployment", {:controller=>"authorization", :action => 'command_domain_selected',:id=>'make_deployment'}, :remote=> true %><br /></a>
<%= f.radio_button :domain, '1dev' %> <%= label :domain, '1dev'%><br />
<%= f.radio_button :domain, '2dev' %> <%= label :domain, '2dev'%><br />
<script type=text/javascript>
$('a').click(function(){ $('form').submit(); return false; });
</script>
<%end%>
当我点击Make Deployment
上面代码中的“”链接时,只有selected radio button
被作为参数传递给command_domain_selected
控制器中的操作。请让我知道如何传递值hyperlink
。谢谢
我也添加了以下代码:
<%= link_to 'Make Deployment', "#", :onclick=>"$('.search_form').submit()" , :id => 'make_deployment'%>
但是传递的参数只是单选按钮值而不是超链接值