Schienen: Wie kann man die ActionView::MissingTemplate Fehler?

Bin ich immer diese Fehlermeldung:

Started POST "/submitEmailAddress" for 127.0.0.1 at 2015-03-13 15:29:26 +0100
Processing by OnepagerController#submitEmailAddress as JS
  Parameters: {"utf8"=>"✓", "email"=>"[email protected]", "commit"=>"OK, LET'S GO!"}
submitEmailAddress
Completed 500 Internal Server Error in 12ms

ActionView::MissingTemplate (Missing template onepager/submitEmailAddress, application/submitEmailAddress with {:locale=>[:en], :formats=>[:js, :html], :variants=>[], :handlers=>[: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)

Wenn ich versuchen, zu senden eine E-Mail mit diesem Formular:

(innen index.html-Code.erb)

<div class="row">
    <div class="col-md-6 col-md-offset-3 col-sm-6 col-sm-offset-3 col-xs-8 col-xs-offset-2">
        <%= bootstrap_form_tag url: '/submitEmailAddress', remote: true, html: {class: 'emailForm'} do |f| %>
        <%= f.email_field :email, hide_label: true %>
        <%= f.submit "OK, LET'S GO!"%>
        <% end %>
    </div>
</div>

Hier ist meine Methode:

(innen onepager_controller.rb)

def submitEmailAddress
    puts "inside submitEmailAddress"

    respond_to do |format|
        format.html {redirect_to root_path}
        format.js
    end
end

- Und das ist meine Routen:

(aus meiner Routen.rb)

root 'onepager#index'
post 'submitEmailAddress', to: 'onepager#submitEmailAddress'

Irgendeine Idee, wie ich diese Fehler beheben kann?

  • Gibt es onepager/submitEmailAddress Vorlage?
InformationsquelleAutor allegutta | 2015-03-13
Schreibe einen Kommentar