Hotwired wi[
This commit is contained in:
5
app/views/hello/_employer.html.erb
Normal file
5
app/views/hello/_employer.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<%= turbo_frame_tag dom_id(employer) do %>
|
||||
<div class="card card-body">
|
||||
<div><%= @employer.name %></div>
|
||||
</div>
|
||||
<% end %>
|
||||
2
app/views/hello/_employer.json.jbuilder
Normal file
2
app/views/hello/_employer.json.jbuilder
Normal file
@@ -0,0 +1,2 @@
|
||||
json.extract! employer, :id, :name
|
||||
|
||||
23
app/views/hello/_form.html.erb
Normal file
23
app/views/hello/_form.html.erb
Normal file
@@ -0,0 +1,23 @@
|
||||
<%= form_with(model: employer, id: dom_id(employer)) do |form| %>
|
||||
<% if employer.errors.any? %>
|
||||
<div id="error_explanation">
|
||||
<h2><%= pluralize(employer.errors.count, "error") %> prohibited this employer from being saved:</h2>
|
||||
|
||||
<ul>
|
||||
<% tweet.errors.each do |error| %>
|
||||
<li><%= error.full_message %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="field">
|
||||
<%= form.label :name %>
|
||||
<%= form.text_area :name %>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<%= form.submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
243
app/views/hello/index.html.erb
Normal file
243
app/views/hello/index.html.erb
Normal file
File diff suppressed because one or more lines are too long
1
app/views/hello/index.json.jbuilder
Normal file
1
app/views/hello/index.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.array! @employers, partial: "tweets/tweet", as: :employer
|
||||
Reference in New Issue
Block a user