title: Setting view formats for custom mimetypes in Ruby on Rails?
body: <p>I'm creating a custom mimetype in rails to use with respond_to</p>
  
  <p><code>Mime::Type.register_alias "text/html", :modal</code></p>
  
  <p>I want to use this mime type in respond_to like so:</p>
  
  <pre><code>respond_to do |format|                                                                                                                                     
    format.html{ render 'index'}                                                                                                                             
    format.modal{ render 'index', :layout =&gt; 'bare'}                                                                                      
   end  
  </code></pre>
  
  <p>I want this format to basically serve the same views as the .thml format but with a different layout</p>
  
  <p>I'm getting a missing template error</p>
  
  <p><code>Missing template support/index with {:handlers=&gt;[:erb, :rjs, :builder, :rhtml, :rxml], :formats=&gt;[:modal], :locale=&gt;[:en, :en]} in view paths "/remote/app/views",</code></p>
  
  <p>its looking for a view named <code>index.modal.erb</code>
  i currently only have <code>index.html.erb</code></p>
  
  <p>I've tried creating the <code>index.modal.erb</code> and it does work but then the layout has the same problem i only have a layout at <code>bare.html.erb</code></p>
  
  <p>I really don't want to duplicate these view files for the different mime types. I'm hoping theres a way to have the custom mime type fall back on to html views that i am missing.</p>