link_to 的问题


在一个link上有三个效果,第一个是切换icon图片,第二个是dropdown,第三个是remote 到action进行操作


 <%= link_to notification_be_read_path, remote: true ,:class=>"dropdown-toggle", :id=>"dLabel", :role=>"button", :data=>{:taggle=>"dropdown",:target=>"#"} do   %>
...
<% end %>

js如下


 $(".dropdown-toggle").on('click',function(){
   if ($("#active_notification").length > 0) {
     $("#active_notification").hide();
   }
   $("#none_notification").show();
});
$(".dropdown-toggle").dropdown();

现在的情况是js都好用,但是remote 到controller action没反应,求大家帮忙,谢谢了

ruby-on-rails

文森特·瓦伦丁 11 years, 4 months ago

Your Answer