Skip to content

Commit

Permalink
Arregla y organizacion adicion/eliminacion basica en marco logico
Browse files Browse the repository at this point in the history
  • Loading branch information
vtamara committed Dec 6, 2024
1 parent ddab632 commit fefc134
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
child_index: params[:index] do |subf| %>
<% if params["agregar-indicadorobjetivo"] %>
<%= turbo_stream.replace "agregar-indicadorobjetivo" do %>
<%= f.submit "Agregar #{Cor1440Gen::Proyectofinanciero.human_attribute_name(:indicadorobjetivo)}",
<%= f.submit "Agregar #{Cor1440Gen::Indicadorpf.human_attribute_name(:indicadorobjetivo)}",
class: "btn btn-sm btn-primary",
data: {
disable_with: false
},
formaction: cor1440_gen.crear_indicadorpf_proyectofinanciero_path(
subf.index.to_i + 1
),
formmethod: :post,
formnovalidate: true,
class: "btn btn-sm btn-primary",
id: "agregar-indicadorobjetivo",
data: {
disable_with: false
} %>
name: "agregar-indicadorobjetivo" %>
<% end %>

<%= turbo_stream.append "indicadoresobjetivo_marco" do %>
Expand All @@ -26,17 +27,18 @@
<% end %>
<% elsif params["agregar-indicadorpf"] %>
<%= turbo_stream.replace "agregar-indicadorpf" do %>
<%= f.submit "Agregar #{Cor1440Gen::Proyectofinanciero.human_attribute_name(:indicadorpf)}",
<%= f.submit "Agregar #{Cor1440Gen::Indicadorpf.human_attribute_name(:indicadorpf)}",
class: "btn btn-sm btn-primary",
data: {
disable_with: false
},
formaction: cor1440_gen.crear_indicadorpf_proyectofinanciero_path(
subf.index.to_i + 1
),
formmethod: :post,
formnovalidate: true,
class: "btn btn-sm btn-primary",
id: "agregar-indicadorpf",
data: {
disable_with: false
} %>
name: "agregar-indicadorpf" %>
<% end %>

<%= turbo_stream.append "indicadorespf_marco" do %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
<%= fields model: @proyectofinanciero do |f| %>
<%= f.simple_fields_for :indicadorpf,
child_index: params[:index] do |subf| %>
<%= turbo_frame_tag "indicadorpf_#{subf.index}" do %>
<%= subf.hidden_field :id, value: params[:id] %>
<%= subf.hidden_field :_destroy, value: true %>
<% end %>
<% if params[:commit] && params[:commit] == "Eliminar I.O." %>
<%= f.simple_fields_for :indicadorobjetivo,
child_index: params[:index] do |subf| %>
<%= turbo_frame_tag "indicadorobjetivo_#{subf.index}" do %>
<%= subf.hidden_field :id, value: params[:id] %>
<%= subf.hidden_field :_destroy, value: true %>
<% end %>
<% end%>
<% elsif params[:commit] && params[:commit] == "Eliminar I.R." %>
<%= f.simple_fields_for :indicadorpf,
child_index: params[:index] do |subf| %>
<%= turbo_frame_tag "indicadorpf_#{subf.index}" do %>
<%= subf.hidden_field :id, value: params[:id] %>
<%= subf.hidden_field :_destroy, value: true %>
<% end %>
<% end%>
<% end %>
<% end %>
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@
</div>
<div class="enlace-agregar-indicadorobjetivo">
<%= f.submit "Agregar #{Cor1440Gen::Indicadorpf.human_attribute_name(:indicadorobjetivo)}",
class: 'btn btn-sm btn-primary',
data: {
disable_with: false
},
formaction: cor1440_gen.crear_indicadorpf_proyectofinanciero_path(
index: @proyectofinanciero.indicadorpf.size
),
formmethod: :post,
formnovalidate: true,
class: 'btn btn-sm btn-primary',
name: "agregar-indicadorobjetivo",
id: "agregar-indicadorobjetivo",
data: {
disable_with: false
} %>
name: "agregar-indicadorobjetivo" %>
</div> <!-- .enlace -->
</div> <!-- panel-body -->
</div> <!-- panel -->
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@

<div class="enlace-agregar-indicadorpf">
<%= f.submit "Agregar #{Cor1440Gen::Indicadorpf.human_attribute_name(:indicadorpf)}",
class: 'btn btn-sm btn-primary',
data: {
disable_with: false
},
formaction: cor1440_gen.crear_indicadorpf_proyectofinanciero_path(
index: @proyectofinanciero.indicadorpf.size
),
formmethod: :post,
formnovalidate: true,
class: 'btn btn-sm btn-primary',
name: "agregar-indicadorpf",
id: "agregar-indicadorpf",
data: {
disable_with: false
} %>
name: "agregar-indicadorpf" %>
</div> <!-- .enlace -->

</div> <!-- panel-body -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
<div class="div-tabla-celda">
<%= f.input :id, as: :hidden %>

<%= f.submit "Eliminar",
<%= f.submit "Eliminar I.O.",
formaction: cor1440_gen.eliminar_indicadorpf_proyectofinanciero_path(
id: f.object.id, index: f.index || params[:index]
),
formmethod: :delete,
formnovalidate: true,
class: 'btn btn-sm btn-danger',
data: {
turbo_frame: "inicadorobjetivo_#{f.index}",
turbo_frame: "indicadorobjetivo_#{f.index}",
disable_with: false
} %>
<div><%= f.error_notification %></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@
<div class="div-tabla-celda">
<%= f.input :id, as: :hidden %>

<%= f.submit "Eliminar",
<%= f.submit "Eliminar I.R.",
formaction: cor1440_gen.eliminar_indicadorpf_proyectofinanciero_path(
id: f.object.id, index: f.index || params[:index]
),
formmethod: :delete,
formnovalidate: true,
class: 'btn btn-sm btn-danger',
data: {
data: {
que: "indicadorpf",
turbo_frame: "indicadorpf_#{f.index}",
disable_with: false
} %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ def preparar_indicadorpf_proyectofinanciero
Cor1440Gen::Proyectofinanciero.new(
indicadorpf: [
Cor1440Gen::Indicadorpf.new
],
indicadorobjetivo: [
Cor1440Gen::Indicadorpf.new
]
)
end
Expand Down

0 comments on commit fefc134

Please sign in to comment.