开发者

Format date in nested form

开发者 https://www.devze.com 2023-04-11 18:24 出处:网络
I\'ve tried this <%= builder.text_field (:start_date).strftime(\'%a\'), :disabled => true, :class => \'input_date_field\' %>

I've tried this

<%= builder.text_field (:start_date).strftime('%a'), :disabled => true, :class => 'input_date_field' %>

and this

module DatesHelper
  def form开发者_开发问答atted_to_day(start_date)
   start_date.strftime("%a")
  end
end

<%= builder.text_field formatted_to_day(:start_date), :disabled => true, :class => 'input_date_field' %>

all to no avail.


Here is the best resource I know of to help point you in the right direction. http://railscasts.com/episodes/31-formatting-time

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号