daily pastebin goal
89%
SHARE
TWEET

Untitled

a guest Feb 21st, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top