Posted By

winson on 04/30/07


Tagged

ajax textmate


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

umang_nine
webstic
davidsi


Respond to Ajax


 / Published in: Rails
 

  1. # CHANGED: Don't do this.
  2. # if request.xhr?
  3. # render :action => "add_with_ajax"
  4. # else
  5. # redirect_to :controller => "catalog"
  6. # end
  7. respond_to do |format|
  8. format.html {redirect_to :controller => "catalog"}
  9. format.js {render :action => "add_with_ajax"}
  10. end

Report this snippet  

You need to login to post a comment.