Module: Fortitude::Rails::Helpers

Defined in:
lib/fortitude/rails/helpers.rb

Constant Summary collapse

FORM_FOR_YIELDED_METHODS_TO_OUTPUT =

form_helper

%w{button check_box color_field date_field datetime_field datetime_local_field} +
%w{email_field file_field hidden_field label month_field number_field password_field phone_field} +
%w{radio_button range_field search_field submit telephone_field text_area text_field time_field url_field} +
%w{week_field} +

# From form_options_helper
%w{select collection_select grouped_collection_select time_zone_select options_for_select} +
%w{options_from_collection_for_select option_groups_from_collection_for_select grouped_options_for_select} +
%w{time_zone_options_for_select collection_radio_buttons collection_check_boxes} +

# And these can nest inside each other
%w{form_for fields_for}

Class Method Summary collapse

Class Method Details

.apply_refined_helpers_to!(o) ⇒ Object


14
15
16
17
18
# File 'lib/fortitude/rails/helpers.rb', line 14

def apply_refined_helpers_to!(o)
  @helpers.each do |name, options|
    o.helper(name, options)
  end
end

.helper(name, options = { }) ⇒ Object


5
6
7
8
# File 'lib/fortitude/rails/helpers.rb', line 5

def helper(name, options = { })
  @helpers ||= { }
  @helpers[name] = options
end

.helper_options(name) ⇒ Object


10
11
12
# File 'lib/fortitude/rails/helpers.rb', line 10

def helper_options(name)
  @helpers[name.to_s.strip.downcase.to_sym]
end