infusionvlc/infusion

View on GitHub
app/views/reports/_review_form.erb

Summary

Maintainability
Test Coverage
<%= form_for(Report.new) do |f| %>
  <div class="field">
    <%= f.label :title %><br>
    <%= f.text_field :title, class:'form-control' %>
  </div>

  <%= f.hidden_field :reportable_id,   value: review.id %>

  <%= f.hidden_field :reportable_type, value: "Assistance" %>

  <div class="field">
    <%= f.label :type_of %><br />
    <%= f.select :type_of, [[(I18n.t 'report.type.hate'), 0 ], [(I18n.t 'report.type.menace'), 1], [(I18n.t 'report.type.pornography'), 2], [(I18n.t 'report.type.community'), 3], [(I18n.t 'report.type.other'), 4]], {}, class: 'form-control' %>
  </div>

  <div class="field">
    <%= f.label :description %><br>
    <%= f.text_field :description, class:'form-control' %>
  </div>
  
  <br/>
  <div class="actions">
    <%= f.submit class: 'btn btn-primary' %>
  </div>
<% end %>