scaffold models
This commit is contained in:
13
app/views/settings/zones/_form.html.erb
Normal file
13
app/views/settings/zones/_form.html.erb
Normal 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 %>
|
||||
2
app/views/settings/zones/_settings_zone.json.jbuilder
Normal file
2
app/views/settings/zones/_settings_zone.json.jbuilder
Normal 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)
|
||||
6
app/views/settings/zones/edit.html.erb
Normal file
6
app/views/settings/zones/edit.html.erb
Normal 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 %>
|
||||
31
app/views/settings/zones/index.html.erb
Normal file
31
app/views/settings/zones/index.html.erb
Normal 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 %>
|
||||
1
app/views/settings/zones/index.json.jbuilder
Normal file
1
app/views/settings/zones/index.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.array! @settings_zones, partial: 'settings_zones/settings_zone', as: :settings_zone
|
||||
5
app/views/settings/zones/new.html.erb
Normal file
5
app/views/settings/zones/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New Settings Zone</h1>
|
||||
|
||||
<%= render 'form', settings_zone: @settings_zone %>
|
||||
|
||||
<%= link_to 'Back', settings_zones_path %>
|
||||
19
app/views/settings/zones/show.html.erb
Normal file
19
app/views/settings/zones/show.html.erb
Normal 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 %>
|
||||
1
app/views/settings/zones/show.json.jbuilder
Normal file
1
app/views/settings/zones/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! "settings_zones/settings_zone", settings_zone: @settings_zone
|
||||
Reference in New Issue
Block a user