Да, вы можете сделать это.
В вашем контроллере,
respond_to do |format|
#format.html # show.html.erb
#format.xml { render :xml => @post }
format.json { render :json => @post }
end
или вы можете обращаться с ним как с 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
Попробуй вот так
format.any(:xml, :html, :json) { render :json => @post }