Feeds:
Posts
Comments

Archive for January 20th, 2011

Greetings!

Today i started to proceed with yesterday’s task

My teammate Ramachandran showed a demo ( which he created ) on how to add our own actions and how to create a view for the corresponding action.

But i dont understand the code written in routes.rb file

To get to know it and also to write the code of my own i started to read the rails guidefrom here http://guides.rubyonrails.org/getting_started.html

While reading, i learnt

i . How to change the default template @ http://0.0.0.0:3000/

ii. How to create my own template that is displayed when browser points to http://0.0.0.0:3000/

Steps i followed to create and display my template

Creating a new rails project


rails new tu -d mysql
cd tu/

Configuring the MySQL database


gedit config/database.yml
rake db:create

Starting the Web Server


rails server

The default template looks as follows

Creating a conrtoller


rails generate controller about index

The above command will create a file called about_controller.rb in app/controllers

Also, it will create a file called index.html.erb in app/views/about/

Open the file about_controller.rb to look its content

 class AboutController < ApplicationController
 def index
 end
 end

Now edit the index.html.erb to have a html code as below


<h1>Welcome to Trainer's Union</h1>

Then remove, index.html ( the file which is rendered when the server starts  )

rm public/index.html

Edit the config/routes.rb

Uncomment the root and include as shown below


root :to => "about#index"

Start the server

rails server

Now the page @ http://0.0.0.0:3000/ looks as below

I explained each and every above steps to my teammate Suresh

He also gave a try and created one 🙂

Then i proceeded to continue reading the guide further

By 4:40 we gathered for a **SCRUM** meet and i told as i learnt how to change the default template and taught to Suresh

After the meet i asked my other team members to show what they have done for today.

But i didnt get a good response 😦

It made me to read and practice a lot 🙂

Will be continued with the tasks by tomorrow too…

 

Advertisements

Read Full Post »