Skip to content

Commit

Permalink
Arregla agregar aporte. Closes #243
Browse files Browse the repository at this point in the history
vtamara committed Apr 23, 2024
1 parent 6e945e1 commit 17625de
Showing 2 changed files with 16 additions and 3 deletions.
14 changes: 14 additions & 0 deletions app/views/aportes/create.turbo_stream.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
<%= simple_fields_for @persona do |f| %>
<%= f.simple_fields_for :aporte,
child_index: params[:index] do |subf| %>
<%= turbo_stream.replace "agregar-aporte" do %>
<%= f.submit "Agregar Aporte",
formaction: main_app.crear_aporte_path(
subf.index.to_i + 1
),
formmethod: :post,
formnovalidate: true,
class: 'btn btn-sm btn-primary',
id: "agregar-aporte",
data: {
disable_with: false
} %>
<% end %>

<%= turbo_stream.append "aportes_marco" do %>
<%= render "msip/personas/aporte_campos", f: subf %>
<% end %>
5 changes: 2 additions & 3 deletions app/views/msip/personas/_campo_aportes.html.erb
Original file line number Diff line number Diff line change
@@ -21,12 +21,11 @@
<%= f.simple_fields_for :aporte,
f.object.aporte.order([:anio,:mes]),
child_index: params[:index] do |apo| %>
x
<!--%= render partial: "aporte_campos", locals: {f: apo} %-->
<%= render partial: "aporte_campos", locals: {f: apo} %>
<% end %>
</div>
</div>
<div class="enlace-agregar-aporte">
<div class="div-agregar-aporte">
<%= f.submit "Agregar Aporte",
formaction: main_app.crear_aporte_path(
index: @persona.aporte.size

0 comments on commit 17625de

Please sign in to comment.