LoginSignup
17

More than 5 years have passed since last update.

railsのf.data_selectで誕生日を「◯年◯月◯日生まれ」の形式で表示

Posted at
<%== sprintf(
 f.date_select(:birthday, :use_month_numbers=>true, :date_separator => '%s', :start_year=>1930, :end_year => Time.now.year, :default =>'1990-1-1'.to_date), '年','月') + '日生まれ' %>

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17