I want to pass a parameter to my controller, its a simple check box but I dont know how I introduce this in my form_for of a model, see this is my view:
<%= form_for @finance,:html => { :id => 'go_finance' } do |f| %>
<br>
Transferir de :<%= f.select :from_money, @places.map { |p| [p.place, p.id] } %>
para: <%= f.select :to_money, @places.map { |p| [p.place, p.id] } %>
<br>
Entrada: <%= f.text_field :input,:id => "input",:placeholder => "Quanto foi ganho ?" %>
Saída: <%= f.text_field :output,:id => "output",:placeholder => "Quanto foi gasto ?" %>
<br>
Nota: <%= f.text_area :note %>
<%= f.submit %>
<% end -%>
I want to make a extra checkbox but how can I make this, no a object in model but a object some to check to make a if else in controller, if check if no check, please help-me and thanks a lot, thanks
You can try to use
check_box_tag<%= check_box_tag :my_attr %>then just check for a
params[:my_attr]in the controller. Ifparams[:my_attr]exists in the controller, then the checkbox is checked.