title: Rails Model inheritance in forms
body: <p>I'm doing a reporting system for my app.
  I created a model ReportKind for example, but as I can report a lot of stuff, I wanted to make different groups of report kinds. Since they share a lot of behavior, I'm trying to use inheritance.</p>
  
  <p>So I have the main model:</p>
  
  <pre><code>model ReportKind &lt;&lt; ActiveRecord::Base
  end
  </code></pre>
  
  <p>and created for example:</p>
  
  <pre><code>model UserReportKind &lt;&lt; ReportKind
  end
  </code></pre>
  
  <p>In my table report_kinds I've the type column, and until here its all working.
  My problem is in the forms/controllers.</p>
  
  <p>When I do a <code>ReportKind.new</code>, my form is build with the '*report_kind*' prefix.
  If a get a <em>UserReportKind</em>, even through a <code>ReportKind.find</code>, the form will build the 'user_report_kind' prefix.</p>
  
  <p>This mess everything in the controllers, since sometimes I'll have params[:report_kind], sometimes params[:user_report_kind], and so on for every other inheritance I made.</p>
  
  <p>Is there anyway to force it to aways use the 'report_kind' prefix?
  Also I had to force the attribute 'type' in the controller, because it didn't get the value direct from the form, is there a pretty way to do this?</p>
  
  <p>Routing was another problem, since it was trying to build routes based in the inherited models names. I overcome that by adding the other models in routes pointing to the same controller.</p>