Refactor creating a new report to use a ReportsController
[rails.git] / app / views / reports / new.html.erb
similarity index 78%
rename from app/views/issues/new.html.erb
rename to app/views/reports/new.html.erb
index 4a33899599115f5bbf4058d9f214ce0282e8b7e8..6dad7aa43a314069ddbcd2f05a112aacd37ef467 100644 (file)
@@ -1,5 +1,5 @@
 <% content_for :heading do %>
-  <h1>Report <%= reportable_url(@issue.reportable) %></h1>
+  <h1>Report <%= reportable_url(@report.issue.reportable) %></h1>
 <% end %>
 
 <div class="disclaimer">
     </ul>
 </div>
 
-<%= form_for(@issue) do |f| %>
+<%= form_for(@report) do |f| %>
   <%= f.error_messages %>
   <fieldset>
-    <div class='form-row'>
-      <%= f.hidden_field :reportable_id %>
-      <%= f.hidden_field :reportable_type %>
-    </div>
+    <%= f.fields_for @report.issue do |issue_form| %>
+      <%= issue_form.hidden_field :reportable_id %>
+      <%= issue_form.hidden_field :reportable_type %>
+    <% end %>
 
     <div class='form-row' style='width:600px'>
       <p><%= t('issues.new.select') %>:</p>