You can use this format:
class PeopleController < ApplicationController
respond_to :html, :xml, :js
def index
@people = Person.find(:all)
respond_with(@people) do |format|
format.html
format.xml
format.js { @people.custom_code_here }
end
end
end
To achieve what you are looking for, if you have a more difficult situation, let me know. See the article in the article on the response_with method for more information .
source
share