Module: Pollett::Concerns::Controllers::KeysController
- Extended by:
- ActiveSupport::Concern
- Included in:
- KeysController
- Defined in:
- lib/pollett/concerns/controllers/keys_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
11 12 13 14 |
# File 'lib/pollett/concerns/controllers/keys_controller.rb', line 11 def create key = current_user.keys.create!(safe_params) render json: key, status: :created end |
#destroy ⇒ Object
21 22 23 24 |
# File 'lib/pollett/concerns/controllers/keys_controller.rb', line 21 def destroy scoped.find(params[:id]).revoke! head :no_content end |
#index ⇒ Object
7 8 9 |
# File 'lib/pollett/concerns/controllers/keys_controller.rb', line 7 def index render_list(scoped) end |
#show ⇒ Object
16 17 18 19 |
# File 'lib/pollett/concerns/controllers/keys_controller.rb', line 16 def show key = scoped.find(params[:id]) render json: key, status: :ok end |