Class: ProvidersController

Inherits:
ApplicationController show all
Defined in:
app/controllers/providers_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#authenticate_admin!, #authenticate_user!, #forbidden_response, #json_request?, #record_not_found, #unauthorized_response

Instance Method Details

#indexObject


4
5
6
7
8
9
10
# File 'app/controllers/providers_controller.rb', line 4

def index
  @providers = Provider.includes(:resources)
  respond_to do |format|
    format.html
    format.json {render json: @providers, status: :ok}
  end
end

#namesObject


17
18
19
20
21
22
23
# File 'app/controllers/providers_controller.rb', line 17

def names
  @names = Provider.all.map {|p| p.name}
  respond_to do |format|
    format.html
    format.json {render json: @names, status: :ok}
  end
end

#update_allObject


12
13
14
15
# File 'app/controllers/providers_controller.rb', line 12

def update_all
  Provider.update_providers
  redirect_to providers_path
end