I would like to sort some of my models better into different folders.
Unfortunately when I do so it is unable to find the models.
I have updated the boot.rb file to:
#Rails::Initializer.run(:set_load_path)
Rails::Initializer.run do |config|
config.frameworks -= [ :action_web_service ]
config.load_paths += %W[
#{RAILS_ROOT}/app/models/
#{RAILS_ROOT}/app/models/associative/
]
end
Rails still does not seem to be able to find the models within the
"associative" folder.
>> pa = PersonAddress.new
NameError: uninitialized constant PersonAddress
from
/Library/Ruby/Gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:266:in
`load_missing_constant''
from
/Library/Ruby/Gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:452:in
`const_missing''
from
/Library/Ruby/Gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:464:in
`const_missing''
from (irb):3
Here is the contents of the file models/associative/person_address.rb:
class PersonAddress < ActiveRecord::Base
end
This post http://errtheblog.com/post/5 is where I saw how to tweak the
root.rb file.
Thanks for the help
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---