Files

Class Index [+]

Quicksearch

Ubiquo::RequiredFields::FormHelper::InstanceMethods

Public Instance Methods

label_with_asterisk(object_name, method, text = nil, options = {}) click to toggle source

Adds “append_asterisk“ option to ‘options’ parameter if the field is maked as required.

    # File vendor/plugins/ubiquo_core/lib/ubiquo/required_fields/form_helper.rb, line 12
12:         def label_with_asterisk(object_name, method, text = nil, options = {})
13:           begin
14:             object_class = options[:object] ? options[:object].class : object_name.to_s.classify.constantize
15:             if object_class && 
16:                 object_class.respond_to?(:required_fields) && 
17:                 object_class.required_fields.include?(method)
18:               options.reverse_merge!("append_asterisk" => true) 
19:             end
20:           rescue NameError => e
21:           end
22:           label_without_asterisk(object_name, method, text, options)
23:         end

Disabled; run with $DEBUG to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.