If I have a block of code like this:
def show @post = Post.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml
or you can handle it as javascript
respond_to do |format| format.js { render :json { :only => :name }.to_json } end
then you just access your action with ".js" in the end.