Display Time ,date ,Year in web page in rails

Hi ..to all ..today i’m going to tell how to display  time ,date,year in a web page in rails..

Its very simple..here are the steps…

Refer my previous post to create listing posts application in rails

I created application with name as myblog .

change to  $ cd /myblog

go to  myblog/app/views/home/index.erb

add this line <p> Its time now  <%= Time.now %></p>

now run the server by   $ rails server

open your browser and type http://localhost:3000

now you can see time and date and year in you web page like this..

Thanks …

Author: Balaji

Hi..My name is Balaji and i am working as a Senior Software Developer in India. I am interested in Shell scripts, python, erlang , linux kernel .

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 )

Connecting to %s

%d bloggers like this: