On 7 September 2012 22:08, ACK wrote:
> hi i m new to rails i need to know the => which is the best way to create
> Database table in Rails?
>
> 1) rails generate model User name:string email:string
> this will create a migration file with something like this
>
> class CreateUsers < ActiveRecord::
thanks for reply
On Sat, Sep 8, 2012 at 9:55 AM, Javier Quarite wrote:
> Rails is smart enough to determine if you want to create or drop a table
> if you have done the migration with change
> def change
> #code here
> end
>
> it only depends on how you write the commands
> if you do
> rake
use def change
forget up and down def
cheers
Fahim Babar Patel
On Sat, Sep 8, 2012 at 9:55 AM, Javier Quarite wrote:
> Rails is smart enough to determine if you want to create or drop a table
> if you have done the migration with change
> def change
> #code here
> end
>
> it only depends on h
Rails is smart enough to determine if you want to create or drop a table if
you have done the migration with change
def change
#code here
end
it only depends on how you write the commands
if you do
rake db:migrate
then it will create the db (if the code inside change is about it) and if
you do
please help me
On Sat, Sep 8, 2012 at 2:38 AM, ACK wrote:
> hi i m new to rails i need to know the => which is the best way to create
> Database table in Rails?
>
> 1) *rails generate model User name:string email:string*
> this will create a migration file with something like this
>
> class Cre
hi i m new to rails i need to know the => which is the best way to create
Database table in Rails?
1) *rails generate model User name:string email:string*
this will create a migration file with something like this
class CreateUsers < ActiveRecord::Migration
def change
create_table :users d
6 matches
Mail list logo