On Nov 25, 12:14 pm, Ray Krueger <[EMAIL PROTECTED]> wrote:
> I tried creating an application that has an "Application" model. This
> seems to collide with the "ApplicationController" defined in
> application.rb.
>
That's about right. Because there is an application.rb in an
appropriate place in the search path Rails may find that file and try
to load it first. While you might be able to fiddle with those so that
rails found your model class first that would then probably screw
things up when Rails is actually looking for ApplicationController.
You might be able to get round this by just explicitly loading your
model rather than relying on the magical loading
Wait for Rails 2.3 where ApplicationController will live in
application_controller.rb :-)
Fred
> For example...
> rails appgoboom
> cd appgoboom
> script/generate scaffold Application name:string
> script/console
> Loading development environment (Rails 2.2.2)>> Application.find(:all)
>
> LoadError: Expected /home/rkrueger/source/rails/appgoboom/app/
> controllers/application.rb to define Application
> from /usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/
> active_support/dependencies.rb:428:in `load_missing_constant'
> from /usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/
> active_support/dependencies.rb:77:in `const_missing'
> from /usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/
> active_support/dependencies.rb:89:in `const_missing'
> from (irb):1
>
> I get the same error when running the application using script/server:
> "Expected /home/rkrueger/source/rails/appgoboom/app/controllers/
> application.rb to define Application"
>
> I've been trying to go through the thesaurus in my head to find other
> names to use than "Application", but honestly Application is what I
> want. Everything else sounds lame...
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---