Commit 1d61991
Changed files (3)
app
controllers
views
my
clients
app/controllers/my/clients_controller.rb
@@ -2,7 +2,9 @@
module My
class ClientsController < ApplicationController
- def index; end
+ def index
+ @clients = Client.all
+ end
def new
@client = Client.new
app/views/my/clients/index.html.erb
@@ -0,0 +1,24 @@
+<div class="container">
+ <div class="row">
+ <div class="col">
+ <h1>Dashboard</h1>
+ <%= link_to t(".new"), new_my_client_path, class: 'btn' %>
+ <table class="table">
+ <thead>
+ <th>Client ID</th>
+ <th>Name</th>
+ <th>Redirect URI</th>
+ </thead>
+ <tbody>
+ <% @clients.each do |client| %>
+ <tr>
+ <td><%= client.to_param %></td>
+ <td><%= client.name %></td>
+ <td><%= client.redirect_uri %></td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+ </div>
+</div>
app/views/my/clients/new.html.erb
@@ -7,10 +7,14 @@
<p>Secret: <%= @client.secret %></p>
<%= form_for @client, url: my_clients_path, method: :post do |form| %>
- <%= form.label :name %>
- <%= form.text_field :name, data: { target: 'clients--new.name' } %>
- <%= form.label :redirect_uri %>
- <%= form.url_field :redirect_uri, data: { target: 'clients--new.redirect_uri' } %>
+ <div class="form-group">
+ <%= form.label :name %>
+ <%= form.text_field :name, data: { target: 'clients--new.name' } %>
+ </div>
+ <div class="form-group">
+ <%= form.label :redirect_uri %>
+ <%= form.url_field :redirect_uri, data: { target: 'clients--new.redirect_uri' } %>
+ </div>
<%= form.submit t(".enable"), class: 'btn btn-primary', data: { disable_with: 'Saving…' } %>
<%= link_to t(".cancel"), my_clients_path, class: 'btn' %>
<% end %>