Saturday, December 25, 2010

Rails session

25/12/2010  --saturday

today we celebrate christmas in our office and we cut the cake and celebrate lots of fun in our office

today our guru chandrashekar sir told the introduction to rails

rails features

today our sir told class responsibilites colloborators

crc (vs) data flow diagram

sir told the difference between them

to generate a model in rails

                rails generate model user

name:string        email:string  password:string

to check the db
                     less config | database.yml

rake db:migrate

to check db exists (or) not

                 rails dbconsole

rails 3 has an inbuilt nice feature of "sqlite" light weighted database

sqlite> .tables           this command will show the list of all tables

sqlite>.schema users      to see the users structure

sqlite>.quit --------> to quit the sqlite

to start a server
                       rails server

another terminal
                               cd rails  again cd tu

like Irb rails console


the above lines stating that creating a new user and assigning a password and email id
and save the rails application

another terminal
                         to show rails console
               SELECT *from users

                SELECT *from users

 users=users.find:all        //it will find all records





vi app/models/user.rb

class User<activeRecord ::Base



and sir also told  guides to ruby on rails

No comments:

Post a Comment