commissioner scaffold

This commit is contained in:
Zin Lin Phyo
2017-08-21 13:30:04 +06:30
parent 06619d30dc
commit 7b0db433c4
26 changed files with 586 additions and 50 deletions

View File

@@ -0,0 +1,2 @@
json.extract! commissioner, :id, :created_at, :updated_at
json.url commissioner_url(commissioner, format: :json)

View File

@@ -0,0 +1,10 @@
<%= simple_form_for(@commissioner) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
</div>
<div class="form-actions">
<%= f.button :submit %>
</div>
<% end %>

View File

@@ -0,0 +1,6 @@
<h1>Editing Commissioner</h1>
<%= render 'form', commissioner: @commissioner %>
<%= link_to 'Show', @commissioner %> |
<%= link_to 'Back', commissioners_path %>

View File

@@ -0,0 +1,25 @@
<p id="notice"><%= notice %></p>
<h1>Commissioners</h1>
<table>
<thead>
<tr>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @commissioners.each do |commissioner| %>
<tr>
<td><%= link_to 'Show', commissioner %></td>
<td><%= link_to 'Edit', edit_commissioner_path(commissioner) %></td>
<td><%= link_to 'Destroy', commissioner, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New Commissioner', new_commissioner_path %>

View File

@@ -0,0 +1 @@
json.array! @commissioners, partial: 'commissioners/commissioner', as: :commissioner

View File

@@ -0,0 +1,5 @@
<h1>New Commissioner</h1>
<%= render 'form', commissioner: @commissioner %>
<%= link_to 'Back', commissioners_path %>

View File

@@ -0,0 +1,4 @@
<p id="notice"><%= notice %></p>
<%= link_to 'Edit', edit_commissioner_path(@commissioner) %> |
<%= link_to 'Back', commissioners_path %>

View File

@@ -0,0 +1 @@
json.partial! "commissioners/commissioner", commissioner: @commissioner