From ff58856c999c2294b8a5ea94eed740d1a5ee6d8f Mon Sep 17 00:00:00 2001 From: Andreas Haller Date: Sun, 17 May 2015 19:19:59 +0200 Subject: [PATCH] Localize date format via rails-i18n --- Gemfile | 1 + Gemfile.lock | 4 ++++ app/views/search/index.html.slim | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 24db6db..0dbccb3 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,7 @@ source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails' +gem 'rails-i18n' # Use sqlite3 as the database for Active Record gem 'sqlite3' gem 'kaminari' diff --git a/Gemfile.lock b/Gemfile.lock index aa98087..52b155f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -134,6 +134,9 @@ GEM rails-deprecated_sanitizer (>= 1.0.1) rails-html-sanitizer (1.0.2) loofah (~> 2.0) + rails-i18n (4.0.4) + i18n (~> 0.6) + railties (~> 4.0) railties (4.2.1) actionpack (= 4.2.1) activesupport (= 4.2.1) @@ -201,6 +204,7 @@ DEPENDENCIES omniauth-browserid pry rails + rails-i18n sass-rails sdoc (~> 0.4.0) slim-rails diff --git a/app/views/search/index.html.slim b/app/views/search/index.html.slim index e830a77..bef6891 100644 --- a/app/views/search/index.html.slim +++ b/app/views/search/index.html.slim @@ -17,7 +17,7 @@ div ' small = doc.originator ' - small = doc.published_at + small = l doc.published_at.to_date = link_to doc.url, target: '_blank' do div = doc.name