Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. get 'tableros/procesar/:ids' => 'tableros#procesar', as: 'procesar'
  2.  
  3. def estados
  4. @estados = Estado.all.order("id ASC")
  5. @estado_ids = []
  6. end
  7.  
  8. def procesar
  9. puts params[:ids].inspect
  10. # alguna lógica
  11. end
  12.  
  13. <h1>Estados</h1>
  14. <%= button_to 'Procesar', procesar_path(@estado_ids), :class => "btn btn-info", method: :get %>
  15. <% @estados.each do |estado| %>
  16. <div class = "cuadro">
  17. <%= button_to "#{estado.nombre}", municipios_path(estado), :class => "btn btn-info", :style => "width: 180px;", method: :get %>
  18. <%= check_box_tag "@estado_ids[]", estado.id %>
  19. </div>
  20. <% end %>
  21.  
  22. <%= button_to 'Procesar', procesar_path(ids: @estado_ids), :class => "btn btn-info", method: :get %>
  23.  
  24. get 'tableros/procesar' => 'tableros#procesar', as: 'procesar'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement