Class: Cms::FormBuilder
- Inherits:
-
ActionView::Helpers::FormBuilder
- Object
- ActionView::Helpers::FormBuilder
- Cms::FormBuilder
- Defined in:
- app/helpers/cms/form_builder.rb
Instance Method Summary collapse
- #cms_drop_down(method, choices, options = {}, html_options = {}) ⇒ Object
- #cms_tag_list(options = {}) ⇒ Object
- #cms_text_editor(method, options = {}) ⇒ Object
- #date_picker(method, options = {}) ⇒ Object
-
#drop_down(method, choices, options = {}, html_options = {}) ⇒ Object
A JavaScript/CSS styled select.
- #tag_list(options = {}) ⇒ Object
- #text_editor(method, options = {}) ⇒ Object
Instance Method Details
#cms_drop_down(method, choices, options = {}, html_options = {}) ⇒ Object
44 45 46 47 48 49 50 51 52 |
# File 'app/helpers/cms/form_builder.rb', line 44 def cms_drop_down(method, choices, ={}, ={}) add_tabindex!() set_default_value!(method, ) = .extract!(:label, :instructions, :default_value) render_cms_form_partial :drop_down, :object_name => @object_name, :method => method, :choices => choices, :options => , :cms_options => , :html_options => end |
#cms_tag_list(options = {}) ⇒ Object
54 55 56 57 58 59 60 |
# File 'app/helpers/cms/form_builder.rb', line 54 def cms_tag_list(={}) add_tabindex!() set_default_value!(:tag_list, ) = .extract!(:label, :instructions, :default_value) render_cms_form_partial :tag_list, :options => , :cms_options => end |
#cms_text_editor(method, options = {}) ⇒ Object
62 63 64 65 66 67 68 69 70 71 |
# File 'app/helpers/cms/form_builder.rb', line 62 def cms_text_editor(method, = {}) add_tabindex!() set_default_value!(method, ) = .extract!(:label, :instructions, :default_value) render_cms_form_partial :text_editor, :id => ([:id] || "#{@object_name}_#{method}"), :editor_enabled => (["editorEnabled"].blank? ? true : (["editorEnabled"] == 'true' || ["editorEnabled"] == ['true'])), :object_name => @object_name, :method => method, :options => , :cms_options => end |
#date_picker(method, options = {}) ⇒ Object
18 19 20 |
# File 'app/helpers/cms/form_builder.rb', line 18 def date_picker(method, ={}) text_field(method, {:size => 10, :class => "date_picker"}.merge()) end |
#drop_down(method, choices, options = {}, html_options = {}) ⇒ Object
A JavaScript/CSS styled select
6 7 8 |
# File 'app/helpers/cms/form_builder.rb', line 6 def drop_down(method, choices, = {}, = {}) @template.drop_down(@object_name, method, choices, (), add_tabindex!(@default_options.merge())) end |
#tag_list(options = {}) ⇒ Object
22 23 24 25 |
# File 'app/helpers/cms/form_builder.rb', line 22 def tag_list(={}) field_name = .delete(:name) || :tag_list text_field(field_name, {:size => 50, :class => "tag-list"}.merge()) end |
#text_editor(method, options = {}) ⇒ Object
10 11 12 13 14 15 16 |
# File 'app/helpers/cms/form_builder.rb', line 10 def text_editor(method, = {}) @template.send( "text_editor", @object_name, method, ()) end |