create sponsor_tier

This commit is contained in:
wyx
2020-07-24 17:38:31 +08:00
parent cb089b1bb8
commit 0a460d1d37
25 changed files with 441 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
<%= simple_form_for(@sponsor_tier) do |f| %>
<%= f.error_notification %>
<%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %>
<div class="form-inputs">
<%= f.input :tier %>
</div>
<div class="form-actions">
<%= f.button :submit %>
</div>
<% end %>

View File

@@ -0,0 +1,2 @@
json.extract! sponsor_tier, :id, :tier, :created_at, :updated_at
json.url sponsor_tier_url(sponsor_tier, format: :json)

View File

@@ -0,0 +1,6 @@
<h1>Editing Sponsor Tier</h1>
<%= render 'form', sponsor_tier: @sponsor_tier %>
<%= link_to 'Show', @sponsor_tier %> |
<%= link_to 'Back', sponsor_tiers_path %>

View File

@@ -0,0 +1,27 @@
<p id="notice"><%= notice %></p>
<h1>Sponsor Tiers</h1>
<table>
<thead>
<tr>
<th>Tier</th>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @sponsor_tiers.each do |sponsor_tier| %>
<tr>
<td><%= sponsor_tier.tier %></td>
<td><%= link_to 'Show', sponsor_tier %></td>
<td><%= link_to 'Edit', edit_sponsor_tier_path(sponsor_tier) %></td>
<td><%= link_to 'Destroy', sponsor_tier, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New Sponsor Tier', new_sponsor_tier_path %>

View File

@@ -0,0 +1 @@
json.array! @sponsor_tiers, partial: "sponsor_tiers/sponsor_tier", as: :sponsor_tier

View File

@@ -0,0 +1,5 @@
<h1>New Sponsor Tier</h1>
<%= render 'form', sponsor_tier: @sponsor_tier %>
<%= link_to 'Back', sponsor_tiers_path %>

View File

@@ -0,0 +1,9 @@
<p id="notice"><%= notice %></p>
<p>
<strong>Tier:</strong>
<%= @sponsor_tier.tier %>
</p>
<%= link_to 'Edit', edit_sponsor_tier_path(@sponsor_tier) %> |
<%= link_to 'Back', sponsor_tiers_path %>

View File

@@ -0,0 +1 @@
json.partial! "sponsor_tiers/sponsor_tier", sponsor_tier: @sponsor_tier