Added doamins
This commit is contained in:
7
app/views/domains/_domain.html.erb
Normal file
7
app/views/domains/_domain.html.erb
Normal file
@@ -0,0 +1,7 @@
|
||||
<div id="<%= dom_id domain %>">
|
||||
<p>
|
||||
<strong>Domain:</strong>
|
||||
<%= domain.domain %>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
2
app/views/domains/_domain.json.jbuilder
Normal file
2
app/views/domains/_domain.json.jbuilder
Normal file
@@ -0,0 +1,2 @@
|
||||
json.extract! domain, :id, :domain, :created_at, :updated_at
|
||||
json.url domain_url(domain, format: :json)
|
||||
22
app/views/domains/_form.html.erb
Normal file
22
app/views/domains/_form.html.erb
Normal file
@@ -0,0 +1,22 @@
|
||||
<%= form_with(model: domain) do |form| %>
|
||||
<% if domain.errors.any? %>
|
||||
<div style="color: red">
|
||||
<h2><%= pluralize(domain.errors.count, "error") %> prohibited this domain from being saved:</h2>
|
||||
|
||||
<ul>
|
||||
<% domain.errors.each do |error| %>
|
||||
<li><%= error.full_message %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div>
|
||||
<%= form.label :domain, style: "display: block" %>
|
||||
<%= form.text_field :domain %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
10
app/views/domains/edit.html.erb
Normal file
10
app/views/domains/edit.html.erb
Normal file
@@ -0,0 +1,10 @@
|
||||
<h1>Editing domain</h1>
|
||||
|
||||
<%= render "form", domain: @domain %>
|
||||
|
||||
<br>
|
||||
|
||||
<div>
|
||||
<%= link_to "Show this domain", @domain %> |
|
||||
<%= link_to "Back to domains", domains_path %>
|
||||
</div>
|
||||
14
app/views/domains/index.html.erb
Normal file
14
app/views/domains/index.html.erb
Normal file
@@ -0,0 +1,14 @@
|
||||
<p style="color: green"><%= notice %></p>
|
||||
|
||||
<h1>Domains</h1>
|
||||
|
||||
<div id="domains">
|
||||
<% @domains.each do |domain| %>
|
||||
<%= render domain %>
|
||||
<p>
|
||||
<%= link_to "Show this domain", domain %>
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= link_to "New domain", new_domain_path %>
|
||||
1
app/views/domains/index.json.jbuilder
Normal file
1
app/views/domains/index.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.array! @domains, partial: "domains/domain", as: :domain
|
||||
9
app/views/domains/new.html.erb
Normal file
9
app/views/domains/new.html.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
<h1>New domain</h1>
|
||||
|
||||
<%= render "form", domain: @domain %>
|
||||
|
||||
<br>
|
||||
|
||||
<div>
|
||||
<%= link_to "Back to domains", domains_path %>
|
||||
</div>
|
||||
10
app/views/domains/show.html.erb
Normal file
10
app/views/domains/show.html.erb
Normal file
@@ -0,0 +1,10 @@
|
||||
<p style="color: green"><%= notice %></p>
|
||||
|
||||
<%= render @domain %>
|
||||
|
||||
<div>
|
||||
<%= link_to "Edit this domain", edit_domain_path(@domain) %> |
|
||||
<%= link_to "Back to domains", domains_path %>
|
||||
|
||||
<%= button_to "Destroy this domain", @domain, method: :delete %>
|
||||
</div>
|
||||
1
app/views/domains/show.json.jbuilder
Normal file
1
app/views/domains/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! "domains/domain", domain: @domain
|
||||
Reference in New Issue
Block a user