-
Notifications
You must be signed in to change notification settings - Fork 178
Form & Table Field Reference
coezbek edited this page Dec 16, 2021
·
4 revisions
text_field :caption
(With bonus enum handling)
resource_states = Resource.states.keys.map { |state| [state.humanize, state] }
select :state, resource_states
static_field :updated_at, resource.updated_at
check_box :is_true?
email_field :email
telephone_field :mobile
collection_check_boxes :resource_ids, Resource.all, :id, :name
collection_radio_buttons :resource_id, Resource.all, :id, :name
collection_select :resource_id, Resource.all, :id, :name
optional
{ multiple: true }
color_field :paint_color
date_field :date_from
date_select :date_to
datetime_field :game_start
datetime_select :game_start
file_field :image
To allow multiple files to be uploaded:
file_field :attachments, multiple: true
The file_field helper works the same as the corresponding Rails form helper (Source: Issue 272).
month_field :season_start
number_field :group_size
password_field :password
tag_select :post_tags
text_area :content
time_field :start_at
time_select :start_at
time_zone_select :current_time_zone
url_field :site_url
week_field :during_week