Scaffold error_templates UI
This commit is contained in:
17
app/views/error_templates/_form.html.erb
Normal file
17
app/views/error_templates/_form.html.erb
Normal file
@ -0,0 +1,17 @@
|
||||
<%= form_for(@error_template) do |f| %>
|
||||
<% if @error_template.errors.any? %>
|
||||
<div id="error_explanation">
|
||||
<h2><%= pluralize(@error_template.errors.count, "error") %> prohibited this error_template from being saved:</h2>
|
||||
|
||||
<ul>
|
||||
<% @error_template.errors.full_messages.each do |message| %>
|
||||
<li><%= message %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="actions">
|
||||
<%= f.submit %>
|
||||
</div>
|
||||
<% end %>
|
6
app/views/error_templates/edit.html.erb
Normal file
6
app/views/error_templates/edit.html.erb
Normal file
@ -0,0 +1,6 @@
|
||||
<h1>Editing Error Template</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Show', @error_template %> |
|
||||
<%= link_to 'Back', error_templates_path %>
|
25
app/views/error_templates/index.html.erb
Normal file
25
app/views/error_templates/index.html.erb
Normal file
@ -0,0 +1,25 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<h1>Listing Error Templates</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @error_templates.each do |error_template| %>
|
||||
<tr>
|
||||
<td><%= link_to 'Show', error_template %></td>
|
||||
<td><%= link_to 'Edit', edit_error_template_path(error_template) %></td>
|
||||
<td><%= link_to 'Destroy', error_template, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<%= link_to 'New Error template', new_error_template_path %>
|
4
app/views/error_templates/index.json.jbuilder
Normal file
4
app/views/error_templates/index.json.jbuilder
Normal file
@ -0,0 +1,4 @@
|
||||
json.array!(@error_templates) do |error_template|
|
||||
json.extract! error_template, :id
|
||||
json.url error_template_url(error_template, format: :json)
|
||||
end
|
5
app/views/error_templates/new.html.erb
Normal file
5
app/views/error_templates/new.html.erb
Normal file
@ -0,0 +1,5 @@
|
||||
<h1>New Error Template</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Back', error_templates_path %>
|
4
app/views/error_templates/show.html.erb
Normal file
4
app/views/error_templates/show.html.erb
Normal file
@ -0,0 +1,4 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<%= link_to 'Edit', edit_error_template_path(@error_template) %> |
|
||||
<%= link_to 'Back', error_templates_path %>
|
1
app/views/error_templates/show.json.jbuilder
Normal file
1
app/views/error_templates/show.json.jbuilder
Normal file
@ -0,0 +1 @@
|
||||
json.extract! @error_template, :id, :created_at, :updated_at
|
Reference in New Issue
Block a user