我有一个变量 @the_date
和一个 date_select 表单助手,没有关联的模型。
如何使用date_select
来显示适当的HTML?
以下方法不起作用:
<%= date_select "the_date", @the_date %>
最佳答案
你可以这样做:
<% @the_date = Time.now %>
<%= date_select("my_date", "my_date", :default => @the_date) %>
关于html - 如何在 Rails 中没有模型的情况下使用 date_select 表单助手?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7522799/