0

I want to use additional route files in my app, so when I add

config.paths['config/routes'] = Dir[Rails.root.join('config/routes/*.rb')]

to my config/application.rb file everything is fine.

The problem occurs, when I try to place this code in my initializer:

MyApp::Application.config.paths['config/routes'] = Dir[Rails.root.join('config/routes/*.rb')]

I check it in the rails console - MyApp::Application.config.paths hold proper path, but it seems that files from config/routes won't load.

How can I resolve this problem?

I'm using Rails 3.2.6.

1 Answer 1

1

Not answering your question directly, but providing a different (better?) approach to what you're trying to do:

Check out this alternative that DHH posted in a gist.

Sign up to request clarification or add additional context in comments.

1 Comment

Wow, it's amazing approach :) And it could be solution for my problem. Thanks :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.