main
 1# frozen_string_literal: true
 2
 3module My
 4  class ClientsController < ApplicationController
 5    def index
 6      @clients = Client.all
 7    end
 8
 9    def new
10      @client = Client.new
11    end
12
13    def create
14      client = Client.create!(secure_params)
15      notice = t(
16        '.success',
17        client_id: client.to_param,
18        client_secret: client.password
19      )
20      redirect_to my_clients_path, notice: notice
21    end
22
23    private
24
25    def secure_params
26      params.require(:client).permit(:name, :password, redirect_uris: [])
27    end
28  end
29end