/ Published in: Rails
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# CHANGED: Don't do this. # if request.xhr? # render :action => "add_with_ajax" # else # redirect_to :controller => "catalog" # end respond_to do |format| format.html {redirect_to :controller => "catalog"} format.js {render :action => "add_with_ajax"} end