0

I got an application that I turned into an engine which has tons of routes. I added the engine to a host app via Gemfile and when I run rake routes everything is displayed properly. However, in the views, the routes aren't found resulting in this error:

I access / and get following error:

No route matches {:controller=>"reports" :action=>"new"}

in file /Users/username/Sites/engine_app/app/views/home/index.html.erb:

<%= link_to 'New Report', new_report_path %>

rake routes:

...
reports#new                      new_report GET    /:locale/reports/new(.:format)
...

Also, I can access /en/reports/new which loads the correct controller and view but get another routing error.

To me, it seems I can access any route directly but the app cannot resolve any xxx_path inside the views at all. Any suggestions?

tshepang
  • 12,111
  • 21
  • 91
  • 136
Cojones
  • 2,930
  • 4
  • 29
  • 41

1 Answers1

1

Considering the lack of details in question, I can think only that you are trying to access it from a wrong url. /:locale/reports/new(.:format)

you probably open the url without locale:

localhos:3000/reports/new

but it should be:

localhos:3000/en/reports/new

rmagnum2002
  • 11,341
  • 8
  • 49
  • 86