Avoid full page reloads on report#show
This commit is contained in:
parent
916b370905
commit
c44c9ccaba
7 changed files with 19 additions and 8 deletions
|
|
@ -1,4 +1,4 @@
|
|||
<%= bootstrap_form_with(model: element, data: { turbo_frame: "_top" }) do |form| %>
|
||||
<%= bootstrap_form_with(model: element, data: element.persisted? || { turbo_frame: "_top" }) do |form| %>
|
||||
<%= form.hidden_field :report_id %>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
|
|
|||
2
app/views/elements/create.turbo_stream.erb
Normal file
2
app/views/elements/create.turbo_stream.erb
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<%= turbo_stream.update "new_element_frame", partial: "reports/new_element_button", locals: { report: @element.report } %>
|
||||
<%= turbo_stream.append "element_list", @element %>
|
||||
|
|
@ -7,6 +7,9 @@
|
|||
<i class="bi bi-card-checklist">
|
||||
</i>
|
||||
<%= @element.title %>
|
||||
<div class="badge text-bg-secondary">
|
||||
<%= @element.path %>
|
||||
</div>
|
||||
</h2>
|
||||
<%= link_to(tag.i(class: "bi bi-pencil"), @element, class: "btn btn-link text-warning") %>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue