Skip to content

DateTimeTag

Antonio Pagano edited this page Jan 29, 2018 · 2 revisions

DateTimeTag creates an input with type "datetime-local" which is useful when dealing with datetime fields. p.e.

//form_for
<%= f.DateTimeTag("ExpiresAt") %>.

//form
<%= f.DateTimeTag({"name": "ExpiresAt", "value": date}) %>

Produce

//form_for
<input name="talk-ExpiresAt" type="datetime-local" value="1976-08-24T06:17" />

//form
<input name="ExpiresAt" type="datetime-local" value="1976-08-24T06:17" />
Clone this wiki locally