Rails 3: redirect_to with :remote => true

后端 未结 4 861
春和景丽
春和景丽 2020-12-20 19:20

I have a delete link that makes a remote call:

<%= link_to image_tag(\"trash.png\"), [current_user, bookcase], method:  :delete, :remote => true, confi         


        
4条回答
  •  粉色の甜心
    2020-12-20 19:51

    I tried the accepted answer but didn't work for me (RAILS 6), what worked for me is this :

    format.js { redirect_to current_user }
    

    Hope this help someone

提交回复
热议问题