Permalink
Browse files

Merge branch 'mod_show'

  • Loading branch information...
2 parents 356355f + 593da01 commit 4037294048791dde9d8fd61f1071b026022ba6a6 @moonfox committed Aug 12, 2011
View
12 app/helpers/application_helper.rb
@@ -1,3 +1,15 @@
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
+ def date_en(ftime)
+ day = ftime.day
+ th = "th"
+
+ case day.to_s[-1,1]
+ when 1 : th = "st"
+ when 2 : th = "nd"
+ when 3 : th = "rd"
+ end
+
+ "#{ftime.strftime("%B %d#{th}, %Y ")}"
+ end
end
View
2 app/views/ga_new_words/index.html.erb
@@ -7,7 +7,7 @@
</h2>
<p class="postmeta">
- <span class="date">Date : August 2nd, 2011</span><span class="category">Category : <a rel="category tag" title="View all posts in 程序开发" href="http://www.gagahappy.com/category/development/?preview=1&amp;template=retweet&amp;stylesheet=retweet">程序开发</a></span><span class="author">Author : <a rel="author" title="Posts by moonfox" href="http://www.gagahappy.com/author/moonfox/?preview=1&amp;template=retweet&amp;stylesheet=retweet">moonfox</a></span><span class="comment"><a title="Comment on rails 页面缓存路径" href="http://www.gagahappy.com/how-rails-caches-page-work/?preview=1&amp;template=retweet&amp;stylesheet=retweet#respond">No
+ <span class="date">Date : <%= date_en(new_word.created_at)%></span><span class="category">Category : <a rel="category tag" title="View all posts in 程序开发" href="http://www.gagahappy.com/category/development/?preview=1&amp;template=retweet&amp;stylesheet=retweet">程序开发</a></span><span class="author">Author : <a rel="author" title="Posts by moonfox" href="http://www.gagahappy.com/author/moonfox/?preview=1&amp;template=retweet&amp;stylesheet=retweet">moonfox</a></span><span class="comment"><a title="Comment on rails 页面缓存路径" href="http://www.gagahappy.com/how-rails-caches-page-work/?preview=1&amp;template=retweet&amp;stylesheet=retweet#respond">No
comments</a></span>
</p>
View
2 app/views/ga_new_words/show.html.erb
@@ -10,7 +10,7 @@
</h2>
<p class="postmeta">
- <span class="date">Date : August 2nd, 2011</span><span class="category">Category : <a rel="category tag" title="View all posts in 程序开发" href="http://www.gagahappy.com/category/development/?preview=1&amp;template=retweet&amp;stylesheet=retweet">程序开发</a></span><span class="author">Author : <a rel="author" title="Posts by moonfox" href="http://www.gagahappy.com/author/moonfox/?preview=1&amp;template=retweet&amp;stylesheet=retweet">moonfox</a></span><span class="comment"><a title="Comment on rails 页面缓存路径" href="http://www.gagahappy.com/how-rails-caches-page-work/?preview=1&amp;template=retweet&amp;stylesheet=retweet#respond">No
+ <span class="date">Date : <%= date_en(@ga_new_word.created_at)%></span><span class="category">Category : <a rel="category tag" title="View all posts in 程序开发" href="http://www.gagahappy.com/category/development/?preview=1&amp;template=retweet&amp;stylesheet=retweet">程序开发</a></span><span class="author">Author : <a rel="author" title="Posts by moonfox" href="http://www.gagahappy.com/author/moonfox/?preview=1&amp;template=retweet&amp;stylesheet=retweet">moonfox</a></span><span class="comment"><a title="Comment on rails 页面缓存路径" href="http://www.gagahappy.com/how-rails-caches-page-work/?preview=1&amp;template=retweet&amp;stylesheet=retweet#respond">No
comments</a></span>
</p>

0 comments on commit 4037294

Please sign in to comment.