blob: a03a67481048e99894db2f48f6e8c603966e5cb4 (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 | class ApiKeysController < ChouetteController
  defaults resource_class: Api::V1::ApiKey
  include PolicyChecker
  def create
    @api_key = Api::V1::ApiKey.new(api_key_params.merge(organisation: current_organisation))
    create! do |format|
      format.html {
        redirect_to dashboard_path
      }
    end
  end
  def update
    update! do |format|
      format.html {
        redirect_to dashboard_path
      }
    end
  end
  def destroy
    destroy! do |format|
      format.html {
        redirect_to dashboard_path
      }
    end
  end
  private
  def api_key_params
    params.require(:api_key).permit(:name, :referential_id)
  end
end
 |