Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (24 sloc) 0.842 kb
# A helper to generate both the text_area tag along with a wysiwyg editor for the same field.
# Any passed options are passed along to the text_area tag.
module ActionView
module Helpers
module Tags
class Wysiwyg < Base #:nodoc:
def render
@template_object.render 'wysiwyg_field', value: value_before_type_cast(object).try(:html_safe), field_name: tag_id
end
end
end
module FormHelper
def wysiwyg_field(object_name, method, options = {})
Tags::TextArea.new(object_name, method, self, options).render +
Tags::Wysiwyg.new(object_name, method, self, options).render
end
end
class FormBuilder
def wysiwyg_field(method, options = {})
@template.wysiwyg_field(@object_name, method, objectify_options(options))
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.