Hi, I am a new comer with Ruby on Rails and i am trying to create a controller for the model and controller is simple def new @test = Test.new end and model is Rails gernerate model Test name:string title:string and it returns me an error: uninitialized constant TestController::Tests Please help Thanks -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Your controller name is plural? TestsController ? I think your problem is that you not are following this name convention ... Sent from my iPhone On May 30, 2011, at 12:03 PM, joanne <joanne0558-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, I am a new comer with Ruby on Rails > and i am trying to create a controller for the model > > and controller is simple > > def new > @test = Test.new > end > > and model is > Rails gernerate model Test name:string title:string > > and it returns me an error: uninitialized constant > TestController::Tests > > > Please help > Thanks > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On May 30, 4:03 pm, joanne <joanne0...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, I am a new comer with Ruby on Rails > and i am trying to create a controller for the model > > and controller is simple > > def new > @test = Test.new > end > > and model is > Rails gernerate model Test name:string title:string > > and it returns me an error: uninitialized constant > TestController::Tests >That sounds like somewhere in your controller you''ve got Tests rather than Test. Also, Test may not be a good name for your class - there is already a module in the ruby std lib called Test Fred> Please help > Thanks-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I have no idea about that. However, I am pretty sure that the name of DB is
correct
and my controller is like this
class LanguagesController < ApplicationController\
def new
@language = Languages.new
end
end
and it points out the problem on "new"
app/controllers/language_controller.rb:7:in `new''
please help
thanks
On Mon, May 30, 2011 at 11:34 AM, Thiago A Pereira
<thiagoalessio-BUHhN+a2lJ4@public.gmane.org>wrote:
> Your controller name is plural?
>
> TestsController ?
>
> I think your problem is that you not are following this name convention ...
>
> Sent from my iPhone
>
> On May 30, 2011, at 12:03 PM, joanne
<joanne0558-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > Hi, I am a new comer with Ruby on Rails
> > and i am trying to create a controller for the model
> >
> > and controller is simple
> >
> > def new
> > @test = Test.new
> > end
> >
> > and model is
> > Rails gernerate model Test name:string title:string
> >
> > and it returns me an error: uninitialized constant
> > TestController::Tests
> >
> >
> > Please help
> > Thanks
> >
> > --
> > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > To unsubscribe from this group, send email to
>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
> >
>
> --
> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>
--
--------------------------------
Thank you,
Yen
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
> @language = Languages.newshould be @language = Language.new singular. not plural On May 30, 2011, at 18:29 , joanne ta wrote:> I have no idea about that. However, I am pretty sure that the name of DB is correct > > and my controller is like this > > class LanguagesController < ApplicationController\ > def new > @language = Languages.new > end > end > > and it points out the problem on "new" > app/controllers/language_controller.rb:7:in `new'' > > please help > thanks > > On Mon, May 30, 2011 at 11:34 AM, Thiago A Pereira <thiagoalessio-BUHhN+a2lJ4@public.gmane.org> wrote: > Your controller name is plural? > > TestsController ? > > I think your problem is that you not are following this name convention ... > > Sent from my iPhone > > On May 30, 2011, at 12:03 PM, joanne <joanne0558-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi, I am a new comer with Ruby on Rails > > and i am trying to create a controller for the model > > > > and controller is simple > > > > def new > > @test = Test.new > > end > > > > and model is > > Rails gernerate model Test name:string title:string > > > > and it returns me an error: uninitialized constant > > TestController::Tests > > > > > > Please help > > Thanks > > > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > > > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > > > > > -- > -------------------------------- > > Thank you, > > Yen > > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.-- ==============================================================================Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz ============================================================================== -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No it is not a plural. On May 30, 11:34 am, Thiago A Pereira <thiagoales...-BUHhN+a2lJ4@public.gmane.org> wrote:> Your controller name is plural? > > TestsController ? > > I think your problem is that you not are following this name convention ... > > Sent from my iPhone > > On May 30, 2011, at 12:03 PM, joanne <joanne0...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > Hi, I am a new comer with Ruby on Rails > > and i am trying to create a controller for the model > > > and controller is simple > > > def new > > @test = Test.new > > end > > > and model is > > Rails gernerate model Test name:string title:string > > > and it returns me an error: uninitialized constant > > TestController::Tests > > > Please help > > Thanks > > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi, I did try it before as well, it still giving me the same error On Mon, May 30, 2011 at 12:34 PM, Tom Meinlschmidt <tomas-ooGa/4BNRfTT2+6r9I86XQ@public.gmane.org>wrote:> > @language = Languages.new > > should be @language = Language.new > > singular. not plural > > > On May 30, 2011, at 18:29 , joanne ta wrote: > > > I have no idea about that. However, I am pretty sure that the name of DB > is correct > > > > and my controller is like this > > > > class LanguagesController < ApplicationController\ > > def new > > @language = Languages.new > > end > > end > > > > and it points out the problem on "new" > > app/controllers/language_controller.rb:7:in `new'' > > > > please help > > thanks > > > > On Mon, May 30, 2011 at 11:34 AM, Thiago A Pereira <thiagoalessio-BUHhN+a2lJ4@public.gmane.org> > wrote: > > Your controller name is plural? > > > > TestsController ? > > > > I think your problem is that you not are following this name convention > ... > > > > Sent from my iPhone > > > > On May 30, 2011, at 12:03 PM, joanne <joanne0558-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hi, I am a new comer with Ruby on Rails > > > and i am trying to create a controller for the model > > > > > > and controller is simple > > > > > > def new > > > @test = Test.new > > > end > > > > > > and model is > > > Rails gernerate model Test name:string title:string > > > > > > and it returns me an error: uninitialized constant > > > TestController::Tests > > > > > > > > > Please help > > > Thanks > > > > > > -- > > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > > > > > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > > > > > > > > > -- > > -------------------------------- > > > > Thank you, > > > > Yen > > > > > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > > ==============================================================================> Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache > > www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz > > ==============================================================================> > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- -------------------------------- Thank you, Yen -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
can you post entire error trace? and code of your model as well tom On May 30, 2011, at 18:49 , joanne ta wrote:> Hi, > > I did try it before as well, it still giving me the same error > > > > On Mon, May 30, 2011 at 12:34 PM, Tom Meinlschmidt <tomas-ooGa/4BNRfTT2+6r9I86XQ@public.gmane.org> wrote: > > @language = Languages.new > > should be @language = Language.new > > singular. not plural > > > On May 30, 2011, at 18:29 , joanne ta wrote: > > > I have no idea about that. However, I am pretty sure that the name of DB is correct > > > > and my controller is like this > > > > class LanguagesController < ApplicationController\ > > def new > > @language = Languages.new > > end > > end > > > > and it points out the problem on "new" > > app/controllers/language_controller.rb:7:in `new'' > > > > please help > > thanks > > > > On Mon, May 30, 2011 at 11:34 AM, Thiago A Pereira <thiagoalessio-BUHhN+a2lJ4@public.gmane.org> wrote: > > Your controller name is plural? > > > > TestsController ? > > > > I think your problem is that you not are following this name convention ... > > > > Sent from my iPhone > > > > On May 30, 2011, at 12:03 PM, joanne <joanne0558-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hi, I am a new comer with Ruby on Rails > > > and i am trying to create a controller for the model > > > > > > and controller is simple > > > > > > def new > > > @test = Test.new > > > end > > > > > > and model is > > > Rails gernerate model Test name:string title:string > > > > > > and it returns me an error: uninitialized constant > > > TestController::Tests > > > > > > > > > Please help > > > Thanks > > > > > > -- > > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > > > > > > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > > > > > > > > > > -- > > -------------------------------- > > > > Thank you, > > > > Yen > > > > > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > ==============================================================================> Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache > > www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz > ==============================================================================> > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > > > > > -- > -------------------------------- > > Thank you, > > Yen > > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.-- ==============================================================================Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz ============================================================================== -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 30 May 2011 17:29, joanne ta <joanne0558-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have no idea about that. However, I am pretty sure that the name of DB is > correct > and my controller is like this > class LanguagesController < ApplicationController\There should be no \ on the end of the line. If this is just a typing error in the email then it is very important that when posting code you should always copy and paste rather than re-typing. If the code you post is not identical to that which you actually have then this just causes confusion.> def new > @language = Languages.new > end > end > and it points out the problem on "new" > > app/controllers/language_controller.rb:7:in `new''The file name for LanguagesController should be languages_controller.rb (plural languages) Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I did copy and paste those code. anyway, I did found the way to solve the problem . thanks all :P On Mon, May 30, 2011 at 12:17 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 30 May 2011 17:29, joanne ta <joanne0558-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I have no idea about that. However, I am pretty sure that the name of DB > is > > correct > > and my controller is like this > > class LanguagesController < ApplicationController\ > > There should be no \ on the end of the line. If this is just a typing > error in the email then it is very important that when posting code > you should always copy and paste rather than re-typing. If the code > you post is not identical to that which you actually have then this > just causes confusion. > > > def new > > @language = Languages.new > > end > > end > > and it points out the problem on "new" > > > > app/controllers/language_controller.rb:7:in `new'' > > The file name for LanguagesController should be > languages_controller.rb (plural languages) > > Colin > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- -------------------------------- Thank you, Yen -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.