app/controllers/providers_controller.rb
# load resource must be before authorize resource
load resource must be before authorize resource
load resource must be before authorize resource
def index
    @providers = Provider.alphabetical.page(params[:page]).per(20)
    respond_to do |wants|
      wants.html {}
      wants.js {}
      wants.json { render json: @providers.to_json(:only => [:title, :given_name, :family_name, :npi]) }
    end
  end
def index @providers = Provider . alphabetical . page ( params [ :page ] ) . per ( 20 ) respond_to do | wants | wants . html { } wants . js { } wants . json { render json : @providers . to_json ( :only => [ :title , :given_name , :family_name , :npi ] ) } end end
load resource must be before authorize resource
load resource must be before authorize resource