Created
October 19, 2016 04:25
-
-
Save dkumar431/7d99b2c0699f8bd820861deba6bc0825 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class StudentController < ApplicationController | |
respond_to :html, :xml, :json | |
def index | |
begin | |
@students = Student.all | |
# respond_to do |format| | |
# format.html { Rails.logger.warn { "html executed." } } | |
# format.js {render "show_person_details"} | |
# format.xml { render :xml => @students.to_xml } | |
# format.json { render json: @students} | |
# end | |
respond_with(@students) | |
rescue => e | |
Rails.logger.warn { "ajay sahu warn: " } | |
Rails.logger.error { "deepak kumar error: #{e.class} #{e.message} #{e.backtrace}" } | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment