title: Rails: How to fix the ActionView::MissingTemplate error?
body: <p>I am getting this error:</p>
  
  <pre><code>Started POST "/submitEmailAddress" for 127.0.0.1 at 2015-03-13 15:29:26 +0100
  Processing by OnepagerController#submitEmailAddress as JS
    Parameters: {"utf8"=&gt;"✓", "email"=&gt;"testing@this.com", "commit"=&gt;"OK, LET'S GO!"}
  submitEmailAddress
  Completed 500 Internal Server Error in 12ms
  
  ActionView::MissingTemplate (Missing template onepager/submitEmailAddress, application/submitEmailAddress with {:locale=&gt;[:en], :formats=&gt;[:js, :html], :variants=&gt;[], :handlers=&gt;[:erb, :builder, :raw, :ruby, :coffee, :jbuilder]}. Searched in:
    * "/Users/ola/.rvm/gems/ruby-2.2.0/gems/web-console-2.0.0/lib/action_dispatch/templates"
    * "/Users/ola/Documents/RailsApps/newwp/app/views"
    * "/Users/ola/.rvm/gems/ruby-2.2.0/gems/videojs_rails-4.6.1/app/views"
  ):
    app/controllers/onepager_controller.rb:22:in `submitEmailAddress'
  
  
    Rendered /Users/ola/.rvm/gems/ruby-2.2.0/gems/web-console-2.0.0/lib/action_dispatch/templates/rescues/missing_template.text.erb (0.3ms)
  </code></pre>
  
  <p>When I try to submit an email with this form:</p>
  
  <p>(inside <strong>index.html.erb</strong>)</p>
  
  <pre><code>&lt;div class="row"&gt;
      &lt;div class="col-md-6 col-md-offset-3 col-sm-6 col-sm-offset-3 col-xs-8 col-xs-offset-2"&gt;
          &lt;%= bootstrap_form_tag url: '/submitEmailAddress', remote: true, html: {class: 'emailForm'} do |f| %&gt;
          &lt;%= f.email_field :email, hide_label: true %&gt;
          &lt;%= f.submit "OK, LET'S GO!"%&gt;
          &lt;% end %&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Here is my method:</p>
  
  <p>(inside <strong>onepager_controller.rb</strong>)</p>
  
  <pre><code>def submitEmailAddress
      puts "inside submitEmailAddress"
  
      respond_to do |format|
          format.html {redirect_to root_path}
          format.js
      end
  end
  </code></pre>
  
  <p>And this is my routes:</p>
  
  <p>(from my <strong>routes.rb</strong>)</p>
  
  <pre><code>root 'onepager#index'
  post 'submitEmailAddress', to: 'onepager#submitEmailAddress'
  </code></pre>
  
  <p>Any idea of how I can fix this error?</p>