hi!! i am a newbie in ROR, I am getting this error i understand what the error says but don''y know why i am getting this error. ActiveRecord::StatementInvalid in UserController#new Mysql::Error: Table ''user.users'' doesn''t exist: SHOW FULL FIELDS FROM `users` def new @user = User.new end def edit my user controller file contains :- class UserController < ApplicationController def index end def show end def new @user = User.new end def edit end def update end def destroy end def home end def create end end user model contains:- class User < ActiveRecord::Base end i have created the databases name user and a table named user_info but still i am getting this error. can someone please help me with this error also can someone please explain the naming rules for model and controller. Thanks''s in Advance :) -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
you are going in wrong way dud , you should have the users table you are creating model name user which is finding the table user and that is not their change the table name from user_info to users you will get your answer :) On Thu, May 9, 2013 at 12:56 PM, ank k. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> hi!! i am a newbie in ROR, I am getting this error i understand what the > error says but don''y know why i am getting this error. > > > > > ActiveRecord::StatementInvalid in UserController#new > > Mysql::Error: Table ''user.users'' doesn''t exist: SHOW FULL FIELDS FROM > `users` > > > > def new > @user = User.new > end > > def edit > > > my user controller file contains :- > > class UserController < ApplicationController > > def index > end > > def show > end > > def new > @user = User.new > end > > def edit > end > > def update > end > > def destroy > end > > def home > end > > def create > end > end > > > user model contains:- > > class User < ActiveRecord::Base > end > > > i have created the databases name user and a table named user_info > but still i am getting this error. > > > > can someone please help me with this error > > also can someone please explain the naming rules for model and > controller. > > Thanks''s in Advance :) > > -- > 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 unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Arvind Vyas wrote in post #1108369:> you are going in wrong way dud , you should have the users table > > you are creating model name user which is finding the table user and > that > is not their change the table name from user_info to users > you will get your answer :)hey!! thanks for the reply.. could you please explain me the naming conventions for model and controller i am a bit confused with it.. Thanks.. :) -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
go through this tutorials http://guides.rubyonrails.org/getting_started.html On Thu, May 9, 2013 at 1:16 PM, ank k. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Arvind Vyas wrote in post #1108369: > > you are going in wrong way dud , you should have the users table > > > > you are creating model name user which is finding the table user and > > that > > is not their change the table name from user_info to users > > you will get your answer :) > > > hey!! thanks for the reply.. > could you please explain me the naming conventions for model and > controller i am a bit confused with it.. > > Thanks.. :) > > -- > 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 unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Take the model name and pluralize it. User model is "users" table Company model is "companies" table. These tables should be created using migrations, not manually in the database by yourself. Have a read of this: http://guides.rubyonrails.org/migrations.html On 09/05/13 16:46, ank k. wrote:> Arvind Vyas wrote in post #1108369: >> you are going in wrong way dud , you should have the users table >> >> you are creating model name user which is finding the table user and >> that >> is not their change the table name from user_info to users >> you will get your answer :) > > hey!! thanks for the reply.. > could you please explain me the naming conventions for model and > controller i am a bit confused with it.. > > Thanks.. :) >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On 9 May 2013 08:46, ank k. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> ... > could you please explain me the naming conventions for model and > controller i am a bit confused with it..I suggest working right through a good tutorial such as railstutorial.org (which is free to use online). That will show you the basics of Rails. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Try this for the naming conventions http://itsignals.cascadia.com.au/?p=7 On May 9, 2013, at 3:26 AM, "ank k." <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> hi!! i am a newbie in ROR, I am getting this error i understand what the > error says but don''y know why i am getting this error. > > > > > ActiveRecord::StatementInvalid in UserController#new > > Mysql::Error: Table ''user.users'' doesn''t exist: SHOW FULL FIELDS FROM > `users` > > > > def new > @user = User.new > end > > def edit > > > my user controller file contains :- > > class UserController < ApplicationController > > def index > end > > def show > end > > def new > @user = User.new > end > > def edit > end > > def update > end > > def destroy > end > > def home > end > > def create > end > end > > > user model contains:- > > class User < ActiveRecord::Base > end > > > i have created the databases name user and a table named user_info > but still i am getting this error. > > > > can someone please help me with this error > > also can someone please explain the naming rules for model and > controller. > > Thanks''s in Advance :) > > -- > 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit https://groups.google.com/groups/opt_out. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On Thu, May 9, 2013 at 7:20 AM, Scott Eisenberg <scott2-5XihT3XKyOKakBO8gow8eQ@public.gmane.org> wrote:> Try this for the naming conventions > > http://itsignals.cascadia.com.au/?p=7 > > > On May 9, 2013, at 3:26 AM, "ank k." <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > hi!! i am a newbie in ROR, I am getting this error i understand what the > error says but don''y know why i am getting this error....> i have created the databases name user and a table named user_info > but still i am getting this error. > > > > can someone please help me with this error > > also can someone please explain the naming rules for model and > controller. > > Thanks''s in Advance :)No, look, really, just STOP banging away and take Colin''s excellent advice. Work ALL THE WAY through the tutorial FIRST. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.