aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/CHANGELOG.md
diff options
context:
space:
mode:
authorKoki Ryu <liukoki@gmail.com>2018-03-06 22:27:23 +0900
committerKoki Ryu <liukoki@gmail.com>2018-06-10 21:07:59 +0900
commit8f46a23d378cd807ff6c4a3b8e35723d4ef81432 (patch)
treeb639e9e230da476c41906816af19fae0e2bbda8c /actionview/CHANGELOG.md
parentfcfe29cd2641b2ce3c01bc13f39d617ec302fc8d (diff)
downloadrails-8f46a23d378cd807ff6c4a3b8e35723d4ef81432.tar.gz
rails-8f46a23d378cd807ff6c4a3b8e35723d4ef81432.tar.bz2
rails-8f46a23d378cd807ff6c4a3b8e35723d4ef81432.zip
Add `year_format` option to date_select tag. This option makes it possible to customize year
names. Lambda should be passed to use this option. Example: date_select('user_birthday', '', start_year: 1998, end_year: 2000, year_format: ->year { "Heisei #{year - 1988}" }) The HTML produced: <select id="user_birthday__1i" name="user_birthday[(1i)]"> <option value="1998">Heisei 10</option> <option value="1999">Heisei 11</option> <option value="2000">Heisei 12</option> </select> /* The rest is omitted */
Diffstat (limited to 'actionview/CHANGELOG.md')
-rw-r--r--actionview/CHANGELOG.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/actionview/CHANGELOG.md b/actionview/CHANGELOG.md
index 2c1ca12043..e8caa916ec 100644
--- a/actionview/CHANGELOG.md
+++ b/actionview/CHANGELOG.md
@@ -1,3 +1,19 @@
+* Add `year_format` option to date_select tag. This option makes it possible to customize year
+ names. Lambda should be passed to use this option. Example:
+
+ date_select('user_birthday', '', start_year: 1998, end_year: 2000, year_format: ->year { "Heisei #{year - 1988}" })
+
+ The HTML produced:
+
+ <select id="user_birthday__1i" name="user_birthday[(1i)]">
+ <option value="1998">Heisei 10</option>
+ <option value="1999">Heisei 11</option>
+ <option value="2000">Heisei 12</option>
+ </select>
+ /* The rest is omitted */
+
+ *Koki Ryu*
+
* Fix JavaScript views rendering does not work with Firefox when using
Content Security Policy.