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 Lead Developer in India. I am interested in Shell scripts, python, erlang , linux kernel , Machine Learning.

Leave a comment