first commit
This commit is contained in:
16
app/views/layouts/application.html.erb
Normal file
16
app/views/layouts/application.html.erb
Normal file
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Suggest</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<%= csrf_meta_tags %>
|
||||
<%= csp_meta_tag %>
|
||||
|
||||
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
|
||||
<%= javascript_include_tag "application", "data-turbo-track": "reload", type: "module" %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<%= yield %>
|
||||
</body>
|
||||
</html>
|
||||
13
app/views/layouts/mailer.html.erb
Normal file
13
app/views/layouts/mailer.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<style>
|
||||
/* Email styles need to be inline */
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<%= yield %>
|
||||
</body>
|
||||
</html>
|
||||
1
app/views/layouts/mailer.text.erb
Normal file
1
app/views/layouts/mailer.text.erb
Normal file
@@ -0,0 +1 @@
|
||||
<%= yield %>
|
||||
32
app/views/suggestions/_form.html.erb
Normal file
32
app/views/suggestions/_form.html.erb
Normal file
@@ -0,0 +1,32 @@
|
||||
<%= form_with(model: suggestion) do |form| %>
|
||||
<% if suggestion.errors.any? %>
|
||||
<div style="color: red">
|
||||
<h2><%= pluralize(suggestion.errors.count, "error") %> prohibited this suggestion from being saved:</h2>
|
||||
|
||||
<ul>
|
||||
<% suggestion.errors.each do |error| %>
|
||||
<li><%= error.full_message %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div>
|
||||
<%= form.label :subject, style: "display: block" %>
|
||||
<%= form.text_field :subject %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.label :body, style: "display: block" %>
|
||||
<%= form.text_area :body %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.label :sent, style: "display: block" %>
|
||||
<%= form.check_box :sent %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
17
app/views/suggestions/_suggestion.html.erb
Normal file
17
app/views/suggestions/_suggestion.html.erb
Normal file
@@ -0,0 +1,17 @@
|
||||
<div id="<%= dom_id suggestion %>">
|
||||
<p>
|
||||
<strong>Subject:</strong>
|
||||
<%= suggestion.subject %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Body:</strong>
|
||||
<%= suggestion.body %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Sent:</strong>
|
||||
<%= suggestion.sent %>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
2
app/views/suggestions/_suggestion.json.jbuilder
Normal file
2
app/views/suggestions/_suggestion.json.jbuilder
Normal file
@@ -0,0 +1,2 @@
|
||||
json.extract! suggestion, :id, :subject, :body, :sent, :created_at, :updated_at
|
||||
json.url suggestion_url(suggestion, format: :json)
|
||||
10
app/views/suggestions/edit.html.erb
Normal file
10
app/views/suggestions/edit.html.erb
Normal file
@@ -0,0 +1,10 @@
|
||||
<h1>Editing suggestion</h1>
|
||||
|
||||
<%= render "form", suggestion: @suggestion %>
|
||||
|
||||
<br>
|
||||
|
||||
<div>
|
||||
<%= link_to "Show this suggestion", @suggestion %> |
|
||||
<%= link_to "Back to suggestions", suggestions_path %>
|
||||
</div>
|
||||
14
app/views/suggestions/index.html.erb
Normal file
14
app/views/suggestions/index.html.erb
Normal file
@@ -0,0 +1,14 @@
|
||||
<p style="color: green"><%= notice %></p>
|
||||
|
||||
<h1>Suggestions</h1>
|
||||
|
||||
<div id="suggestions">
|
||||
<% @suggestions.each do |suggestion| %>
|
||||
<%= render suggestion %>
|
||||
<p>
|
||||
<%= link_to "Show this suggestion", suggestion %>
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= link_to "New suggestion", new_suggestion_path %>
|
||||
1
app/views/suggestions/index.json.jbuilder
Normal file
1
app/views/suggestions/index.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.array! @suggestions, partial: "suggestions/suggestion", as: :suggestion
|
||||
9
app/views/suggestions/new.html.erb
Normal file
9
app/views/suggestions/new.html.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
<h1>New suggestion</h1>
|
||||
|
||||
<%= render "form", suggestion: @suggestion %>
|
||||
|
||||
<br>
|
||||
|
||||
<div>
|
||||
<%= link_to "Back to suggestions", suggestions_path %>
|
||||
</div>
|
||||
10
app/views/suggestions/show.html.erb
Normal file
10
app/views/suggestions/show.html.erb
Normal file
@@ -0,0 +1,10 @@
|
||||
<p style="color: green"><%= notice %></p>
|
||||
|
||||
<%= render @suggestion %>
|
||||
|
||||
<div>
|
||||
<%= link_to "Edit this suggestion", edit_suggestion_path(@suggestion) %> |
|
||||
<%= link_to "Back to suggestions", suggestions_path %>
|
||||
|
||||
<%= button_to "Destroy this suggestion", @suggestion, method: :delete %>
|
||||
</div>
|
||||
1
app/views/suggestions/show.json.jbuilder
Normal file
1
app/views/suggestions/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! "suggestions/suggestion", suggestion: @suggestion
|
||||
Reference in New Issue
Block a user