ank_k
May 9, 2013, 9:26am
1
hi!! i am a newbie in ROR, I am getting this error i understand what the
error says but don’t 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
ank_k
May 9, 2013, 9:42am
2
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
ank_k
May 9, 2013, 10:01am
3
go through this tutorials
Getting Started with RailsThis guide covers getting up and running with Ruby on Rails.After reading this guide, you will know: How to install Rails, create a new Rails application, and connect your application to a database. The general layout of a...
ank_k
May 9, 2013, 10:30am
4
On 9 May 2013 08:46, ank k. [email protected] 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
ank_k
May 9, 2013, 2:21pm
5
ank_k
May 9, 2013, 10:04am
6
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:
ank_k
May 10, 2013, 5:45am
7
On Thu, May 9, 2013 at 7:20 AM, Scott E. [email protected]
wrote:
Try this for the naming conventions
Index of /
On May 9, 2013, at 3:26 AM, “ank k.” [email protected] 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.
…
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.