Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- get 'tableros/procesar/:ids' => 'tableros#procesar', as: 'procesar'
- def estados
- @estados = Estado.all.order("id ASC")
- @estado_ids = []
- end
- def procesar
- puts params[:ids].inspect
- # alguna lógica
- end
- <h1>Estados</h1>
- <%= button_to 'Procesar', procesar_path(@estado_ids), :class => "btn btn-info", method: :get %>
- <% @estados.each do |estado| %>
- <div class = "cuadro">
- <%= button_to "#{estado.nombre}", municipios_path(estado), :class => "btn btn-info", :style => "width: 180px;", method: :get %>
- <%= check_box_tag "@estado_ids[]", estado.id %>
- </div>
- <% end %>
- <%= button_to 'Procesar', procesar_path(ids: @estado_ids), :class => "btn btn-info", method: :get %>
- get 'tableros/procesar' => 'tableros#procesar', as: 'procesar'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement