Module: Cms::FormTagHelper

Defined in:
app/helpers/cms/form_tag_helper.rb

Instance Method Summary collapse

Instance Method Details



10
11
12
# File 'app/helpers/cms/form_tag_helper.rb', line 10

def drop_down(object, method, choices, options = {}, html_options = {})
  select(object, method, choices, options, html_options)
end

A drop-down is just a specialized HTML select



6
7
8
# File 'app/helpers/cms/form_tag_helper.rb', line 6

def drop_down_tag(name, option_tags = nil, options = {}) 
  select_tag(name, option_tags, options)
end

#text_editor(object_name, method, options = {}) ⇒ Object



27
28
29
# File 'app/helpers/cms/form_tag_helper.rb', line 27

def text_editor(object_name, method, options = {})
  text_area(object_name, method, text_editor_options(options))
end

#text_editor_options(options = {}) ⇒ Object

A text editor is an HTML WYSIWYG editor. The result of this will be a div with a select and a textarea in it.



17
18
19
20
21
# File 'app/helpers/cms/form_tag_helper.rb', line 17

def text_editor_options(options={})
  opts = options.dup
  (opts[:class] ||= "") << " editor"
  opts
end

#text_editor_tag(name, content = nil, options = {}) ⇒ Object



23
24
25
# File 'app/helpers/cms/form_tag_helper.rb', line 23

def text_editor_tag(name, content = nil, options = {})
  text_area_tag(name, content, text_editor_options(options))
end