Sha256: 35d8ccd208adfc4477b59cfd9ba5ea57a0f630b1a4f4c9f737e931dfc2648f4d

Contents?: true

Size: 763 Bytes

Versions: 44

Compression:

Stored size: 763 Bytes

Contents

module Krikri
  ##
  # Handles requests for provider dashboards for 'All Providers' and
  # individual providers by ID.
  #
  # @see Krikri::Provider
  class ProvidersController < ApplicationController
    ##
    # Renders the index view with `@providers` as an Array of {Krikri::Provider}s.
    def index
      @providers = Krikri::Provider.all
    end

    ##
    # Renders the show view for the provider given by `id`.
    def show
      if params[:set_session]
        session[:current_provider] = params[:id]
        redirect_to :back, provider: params[:id]
      elsif params[:clear_session]
        session.delete :current_provider
        redirect_to providers_path
      end
      @current_provider = Krikri::Provider.find(params[:id])
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
krikri-0.15.2 app/controllers/krikri/providers_controller.rb
krikri-0.15.1 app/controllers/krikri/providers_controller.rb
krikri-0.15.0 app/controllers/krikri/providers_controller.rb
krikri-0.14.0 app/controllers/krikri/providers_controller.rb
krikri-0.13.2 app/controllers/krikri/providers_controller.rb
krikri-0.13.1 app/controllers/krikri/providers_controller.rb
krikri-0.13.0 app/controllers/krikri/providers_controller.rb
krikri-0.12.4 app/controllers/krikri/providers_controller.rb
krikri-0.12.3 app/controllers/krikri/providers_controller.rb
krikri-0.12.1 app/controllers/krikri/providers_controller.rb
krikri-0.12.0 app/controllers/krikri/providers_controller.rb
krikri-0.12.0.pre.rc.1 app/controllers/krikri/providers_controller.rb
krikri-0.11.2 app/controllers/krikri/providers_controller.rb
krikri-0.11.1 app/controllers/krikri/providers_controller.rb
krikri-0.11.0 app/controllers/krikri/providers_controller.rb
krikri-0.10.1 app/controllers/krikri/providers_controller.rb
krikri-0.10.0 app/controllers/krikri/providers_controller.rb
krikri-0.9.0 app/controllers/krikri/providers_controller.rb
krikri-0.8.9 app/controllers/krikri/providers_controller.rb
krikri-0.8.8 app/controllers/krikri/providers_controller.rb