Search code examples
ruby-on-railsember.jsember-cli

Ember-CLI: Where is the application route?


I am trying to install the npm package rails-csrf. The instructions on the rails-csrf github site say to "add a before model to your application route so your token is fetched automatically." Where is the application route?

I think it is supposed to be app/routes/application.js but that file does not exist. Shouldn't that be created by default with the ember new command?


Solution

  • It's not created by default.

    You can use the ember-cli's generator to create one:

    $ ember generate route application
    

    Hope this helps!