I am building my first application, and have a couple of quick
questions. Hopefully someone can point me in the right direction.
When I created my model , I noticed a field named “created_at” ,
which comes in handy. But when I retrieve the value , it comes back
very long and un-user friendly. How do I return this date as: Jun 23
08 , or March 21, 2008 , etc?
In my layout , I have some simple CSS which formats some tabs
( li’s ). If we are on a certain page , I would add “class = current”
to make the tab background a different color. How do I differentiate
which page I am on , so I can add the class current to the proper
page?
I am building my first application, and have a couple of quick
questions. Hopefully someone can point me in the right direction.
When I created my model , I noticed a field named “created_at” ,
which comes in handy. But when I retrieve the value , it comes back
very long and un-user friendly. How do I return this date as: Jun 23
08 , or March 21, 2008 , etc?
In my layout , I have some simple CSS which formats some tabs
( li’s ). If we are on a certain page , I would add “class = current”
to make the tab background a different color. How do I differentiate
which page I am on , so I can add the class current to the proper
page?
In your controller set an instance variable such as:
@css_class = “class = current”
Use it in your page as:
<%= @css_class %>
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.