Jquery rails 3表单标签,带遥控器和x27;不要发送或提交详细信息
使用正常的非远程请求时,此表单100%有效。但是,当我设置remote=>true时,它不再发送提交值。我应该完全不同地做这件事,还是我遗漏了什么Jquery rails 3表单标签,带遥控器和x27;不要发送或提交详细信息,jquery,ruby-on-rails,ruby-on-rails-3,form-for,Jquery,Ruby On Rails,Ruby On Rails 3,Form For,使用正常的非远程请求时,此表单100%有效。但是,当我设置remote=>true时,它不再发送提交值。我应该完全不同地做这件事,还是我遗漏了什么 <%= form_tag [voteable, Vote.new], :remote => true do |f| %> <strong class="votes_balance"><%= voteable.votes_for - voteable.votes_against %></stron
<%= form_tag [voteable, Vote.new], :remote => true do |f| %>
<strong class="votes_balance"><%= voteable.votes_for - voteable.votes_against %></strong>
<%= submit_tag :up, { :name => "thumb_direction", :class => "vote_up" } %>
<%= submit_tag :down, { :name => "thumb_direction", :class => "vote_down" } %>
<%= hidden_field_tag :voteable_type, voteable.class %>
<% end %>
应该送
可能有一种更简洁的方法,我也简单地尝试了button_to方法,但不知道如何将其全部压缩
<div id="votes" class="thumbs_up">
<%= form_tag [voteable, Vote.new], :remote => true do |f| %>
<%= hidden_field_tag :voteable_type, voteable.class %>
<%= hidden_field_tag :thumb_direction, "up" %>
<%= submit_tag :up, { :class => "vote_up" } %>
<% end %>
<strong class="votes_balance"><%= voteable.votes_for - voteable.votes_against %></strong>
<%= form_tag [voteable, Vote.new], :remote => true do |f| %>
<%= hidden_field_tag :voteable_type, voteable.class %>
<%= hidden_field_tag :thumb_direction, "down" %>
<%= submit_tag :down, { :class => "vote_down" } %>
<% end %>
</div>
真do | f |%>
“投票”}%>
真do | f |%>
“投票否决”}%>
authenticity_token /8Dkx/EQc+VqgZd8f/eoWevm8AIgOwK0rzXqlGUzDUA=
utf8 ✓
voteable_type Article
thumb_direction up
<div id="votes" class="thumbs_up">
<%= form_tag [voteable, Vote.new], :remote => true do |f| %>
<%= hidden_field_tag :voteable_type, voteable.class %>
<%= hidden_field_tag :thumb_direction, "up" %>
<%= submit_tag :up, { :class => "vote_up" } %>
<% end %>
<strong class="votes_balance"><%= voteable.votes_for - voteable.votes_against %></strong>
<%= form_tag [voteable, Vote.new], :remote => true do |f| %>
<%= hidden_field_tag :voteable_type, voteable.class %>
<%= hidden_field_tag :thumb_direction, "down" %>
<%= submit_tag :down, { :class => "vote_down" } %>
<% end %>
</div>