I have a table speech_databases, and successifully generated scaffolding code for it (controller, model, views). But, when I try to start my controller (http://localhost:3000/speech_databases) I got: ----------------------------------------------------- NameError in Speech databasesController#index uninitialized constant SpeechDatabasis ... This error occured while loading the following files: speech_databasis.rb ----------------------------------------------------- It seems to me like it is trying to load model from SpeechDatabasis class, but I don''t have that file. All I''ve generated is speech_database.rb: ----------------------------------------------------- class SpeechDatabase < ActiveRecord::Base belongs_to :group has_and_belongs_to_many :users end ----------------------------------------------------- -- 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 -~----------~----~----~----~------~----~------~--~---
Humm... singularize beleives that the singular form of "databases" is "databasis" "Databases".singularize => "Databasis" Without having tried this in a real rails app. You should be able to add those lines into config/environment.rb Inflector.inflections do |inflect| inflect.plural(/(database)$/i, ''\1s'') inflect.singular(/(database)s$/i, ''\1'') end It at least worked to add this inside script/console. On 8/23/06, Igor Milovanovic <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I have a table speech_databases, and successifully generated scaffolding > code for it (controller, model, views). > > But, when I try to start my controller > (http://localhost:3000/speech_databases) I got: > > ----------------------------------------------------- > NameError in Speech databasesController#index > uninitialized constant SpeechDatabasis > > ... > > This error occured while loading the following files: > speech_databasis.rb > ----------------------------------------------------- > > It seems to me like it is trying to load model from SpeechDatabasis > class, but I don''t have that file. All I''ve generated is > > speech_database.rb: > ----------------------------------------------------- > class SpeechDatabase < ActiveRecord::Base > belongs_to :group > has_and_belongs_to_many :users > end > ----------------------------------------------------- > > -- > Posted via http://www.ruby-forum.com/. > > > >-- -------------- Jon Gretar Borgthorsson http://www.jongretar.net/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Igor Milovanovic wrote:> It seems to me like it is trying to load model from SpeechDatabasis > class, but I don''t have that file. All I''ve generated isI found the solution. In method paginate, I added option :singular => "speech_database" But I am still confused why it didn''t worked without this option added? -- 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 -~----------~----~----~----~------~----~------~--~---