Create a small Form using Ruby on Rails ! (Rails 2.8.3)


For rails version 2.3.8

For rails3 syntax will have some changes

step 1. First you should name your Project

sathia@ubuntu:~$rails -d mysql form

This will create a folder in your current working directory as ‘form’

‘form’ is name of project . We are connecting with mysql db. Give your root mysql password as .

sathia@ubuntu:~/form$ ls
app db lib public README test vendor
config doc log Rakefile script tmp

sathia@ubuntu:~/form$ cd config/

sathia@ubuntu:~/form/config$ gedit database.yml

step 2.

rake db:create

Databases is now created

step 3. Now make table which will be included into mysql also

sathia@ubuntu:~$script/generate scaffold formname name:string age:integer address:string

now table is created

step 3.

sathia@ubuntu:~$rake db:migrate

By doing this , your database will be upgraded to the latest version. Every time if

you change anything in program. You should give this command

step 4.

Now you should start server .

sathia@ubuntu:~$script/server

step 5.

Now you can see your form @ http://localhost:3000/formname

Thats it !!! 🙂

Advertisements

About sathia

Web developer at cloudmint
This entry was posted in Web. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s