scaffold models

This commit is contained in:
Min Zeya Phyo
2017-04-20 17:01:14 +06:30
parent 0a97947259
commit 0af7d78c3c
145 changed files with 4127 additions and 2 deletions

View File

@@ -0,0 +1,13 @@
<%= simple_form_for(@settings_zone) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.input :name %>
<%= f.input :is_active %>
<%= f.input :created_by %>
</div>
<div class="form-actions">
<%= f.button :submit %>
</div>
<% end %>

View File

@@ -0,0 +1,2 @@
json.extract! settings_zone, :id, :name, :is_active, :created_by, :created_at, :updated_at
json.url settings_zone_url(settings_zone, format: :json)

View File

@@ -0,0 +1,6 @@
<h1>Editing Settings Zone</h1>
<%= render 'form', settings_zone: @settings_zone %>
<%= link_to 'Show', @settings_zone %> |
<%= link_to 'Back', settings_zones_path %>

View File

@@ -0,0 +1,31 @@
<p id="notice"><%= notice %></p>
<h1>Settings Zones</h1>
<table>
<thead>
<tr>
<th>Name</th>
<th>Is active</th>
<th>Created by</th>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @settings_zones.each do |settings_zone| %>
<tr>
<td><%= settings_zone.name %></td>
<td><%= settings_zone.is_active %></td>
<td><%= settings_zone.created_by %></td>
<td><%= link_to 'Show', settings_zone %></td>
<td><%= link_to 'Edit', edit_settings_zone_path(settings_zone) %></td>
<td><%= link_to 'Destroy', settings_zone, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New Settings Zone', new_settings_zone_path %>

View File

@@ -0,0 +1 @@
json.array! @settings_zones, partial: 'settings_zones/settings_zone', as: :settings_zone

View File

@@ -0,0 +1,5 @@
<h1>New Settings Zone</h1>
<%= render 'form', settings_zone: @settings_zone %>
<%= link_to 'Back', settings_zones_path %>

View File

@@ -0,0 +1,19 @@
<p id="notice"><%= notice %></p>
<p>
<strong>Name:</strong>
<%= @settings_zone.name %>
</p>
<p>
<strong>Is active:</strong>
<%= @settings_zone.is_active %>
</p>
<p>
<strong>Created by:</strong>
<%= @settings_zone.created_by %>
</p>
<%= link_to 'Edit', edit_settings_zone_path(@settings_zone) %> |
<%= link_to 'Back', settings_zones_path %>

View File

@@ -0,0 +1 @@
json.partial! "settings_zones/settings_zone", settings_zone: @settings_zone