Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Note Exception: File not found" - when the controller is in different folder #17

Closed
gudata opened this issue Mar 11, 2010 · 3 comments
Closed

Comments

@gudata
Copy link

gudata commented Mar 11, 2010

Hello,
I have moved a lot of my controllers in separate folder by adding this in environment.rb

config.load_paths += %W(
#{RAILS_ROOT}/app/controllers/admin/nomenclature
)

but then the rails-footnotes can't manage to find the controller

in lib/rails-footnotes/notes/controller_note.rb on ActionController::Routing.controller_paths line 30

to fix this I have to add this in environment.rb

ActionController::Routing.controller_paths << "#{RAILS_ROOT}/app/controllers/admin/nomenclature"

I am writting this just to save time for someone else or to help you improve this code block

10x for the nice gem!

@kbrock
Copy link
Contributor

kbrock commented Jun 7, 2010

Now doing a better job of using the controller_paths. (was ignoring before)

Are you namespacing the controllers?
e.g. class Admin::Nomenclature::TheController < ApplicationController

@gudata
Copy link
Author

gudata commented Jul 2, 2010

Yup the controllers are namespaced

@kbrock
Copy link
Contributor

kbrock commented Aug 18, 2010

If you also add your path to the controller_path, it should resolve your issue
ActionController::Routing.controller_paths << #{RAILS_ROOT}/app/controllers/admin/nomenclature

(I got my info from http://www.slideshare.net/jimeh/rails-plugin-development-101-and-some slide 42 )

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants