I have a delete link that makes a remote call:
<%= link_to image_tag("trash.png"), [current_user, bookcase], method: :delete, :remote => true, confirm: "You sure?", title: bookcase.image %>
In my controller, I end the delete function with a redirect:
def destroy
@bookcase.destroy
redirect_to current_user
end
This works, except it's redirecting the user to the 'user/show.html.erb' file instead of the 'user/show.js.erb' file. How can I redirect the user, specifying which format to use?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…