即使我检查并提交,交易也不会被解雇:(
这是为什么?? body
其他一切正在顺利提交
它只是检测并运行事务,即使我检查并提交...
任何人都有任何想法?
控制器
if params[:comment][:call]
transaction.....
end
查看表单(使用ajax远程)
<%=form_for(([@community, @comment]), :remote => true, :class => 'form' ) do |f| %>
<%= f.check_box :call, :label => 'call' %> call
<div class="form-actions">
<div class="input-append">
<%= f.text_field :body, :id => "input", :class => "box" %>
<button type="submit" class="btn">submit</button>
</div>
</div>
<% end %>
评论模型
attr_accessible :icon, :call
....
def call
@call ||= "0"
end
def call=(value)
@call = value
end