Module: BootyboxFormHelper
- Defined in:
- app/helpers/bootybox_form_helper.rb
Instance Method Summary collapse
- #form_group_container(form, method, options = {}, &block) ⇒ Object
-
#form_input_field(form, method, options = {}) ⇒ Object
TODO: Convert this into a form helper that works with form_for etc…
- #form_select_field(form, method, options = {}) ⇒ Object
Instance Method Details
#form_group_container(form, method, options = {}, &block) ⇒ Object
23 24 25 26 27 |
# File 'app/helpers/bootybox_form_helper.rb', line 23 def form_group_container(form, method, = {}, &block) render "/bootybox/forms/form_group_container", :form => form, :method => method, :id => [:id].to_s, :css_class => [:class], :label_text => [:label] || I18n.t(method.to_s, :scope => :form_labels), :content => capture(&block) end |
#form_input_field(form, method, options = {}) ⇒ Object
TODO: Convert this into a form helper that works with form_for etc…
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/helpers/bootybox_form_helper.rb', line 6 def form_input_field(form, method, = {}) if [:validation].blank? [:validation] = [] end [:type] ||= :text_field render :partial => "/bootybox/forms/form_group_input", :locals => { :form => form, :method => method, :label_text => [:label] || I18n.t(method.to_s, :scope => :form_labels), :value => ([:value] || (form.object.send(method) rescue nil) ), :validation => [:validation], :title => [:title], :type => [:type], :tooltip => [:tooltip] } end |
#form_select_field(form, method, options = {}) ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'app/helpers/bootybox_form_helper.rb', line 29 def form_select_field(form, method, = {}) [:collection] ||= [] render :partial => "/bootybox/forms/form_group_select", :locals => { :form => form, :method => method, :label_text => [:label] || I18n.t(method.to_s, :scope => :form_labels), :value => [:value], :title => [:title], :collection => [:collection] } end |