module RacingOnRails::FormTagHelper

Label + form fields HTML

Public Instance Methods

labelled_text(object_name, method, label_text = nil, text = nil, label_options = {}, text_class = nil) click to toggle source
# File app/helpers/racing_on_rails/form_tag_helper.rb, line 11
def labelled_text(object_name, method, label_text = nil, text = nil, label_options = {}, text_class = nil)
  %Q{#{label(object_name, method, "#{label_text || method.to_s.titleize}", label_options)} <div class="labelled #{text_class}" id="#{object_name}_#{method}">#{text || instance_variable_get("@#{object_name}").send(method)}</div>}.html_safe
end
labelled_text_field_tag(attribute, text = attribute.to_s.titleize, value = nil, text_field_options = {}) click to toggle source
# File app/helpers/racing_on_rails/form_tag_helper.rb, line 6
def labelled_text_field_tag(attribute, text = attribute.to_s.titleize, value = nil, text_field_options = {})
  label_options = text_field_options.delete(:label) || {}
  %Q{#{label_tag(attribute, "#{text}", label_options)} #{text_field_tag(attribute, value, text_field_options)}}.html_safe
end