Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Jamil's Profile

GitHub User: jamillion

Site: http://elbii.com

Comments by Jamil

Avatar

To 43. zhubo:

You don't have to remove the respond_to block.

Just add another responder in there to respond to javascript like so:

respond_to do |format|
  format.html # index.html.erb
  format.xml { render :xml => @products }
  format.js # index.js.erb
end