2
I have 2 buttons and each one will have to send a template value and will also be the submit
button 1 and button 2 - depending on the button I click it will send the value to the @rating.type field. Similar to a like and dislike. The possible code I imagine should be on view in the helper form_for
[button 1]:
<%= form_for(@avaliacao) do |f| %>
<%= render 'compartilhado/mensagens_erro', object: f.object %>
<%= f.hidden_field :item_id %>
<div class="field">
<%= f.text_area :avaliacao, placeholder: "Escreva seu Comentario..." %>
</div>
<!-- Seria isso no f.submit?? -->
<div class="col-md-4.5 col-md-offset-8">
<%= f.submit "Avaliar!", class: "btn btn-large btn-primary" %
</div>
<% end %>
Thanks buddy, it worked here! I thought they would have two buttons from Submit! Good to know that you can do things like this!
– Vitor Vezani