Hey all,
I have a quick question regarding the @template.content_tag methos when
creating a custom form builder.
Currently have the following method in my AccessibleBuilder class:
def datetime_select(field, options = {})
required = options.delete :required
label = options.delete :label
@template.content_tag(“div”,
@template.content_tag( “span”, Example Label ) +
super,
:class => (required.nil?) ? ‘’ : ‘required’
)
end
calling:
<%= f.datetime_select :dob %>
inside:
<% form_for :person, :builder => AccessibleBuilder do |f| %>
renders the following:
Any ideas how I can add a conditional somewhere to only render the
:class=>"" if the field is required rather than have the empty class=""
attribute?