Module: Ckeditor::Hooks::SimpleFormBuilder::InstanceMethods

Defined in:
lib/ckeditor/hooks/simple_form.rb

Instance Method Summary collapse

Instance Method Details

#ckeditor(attribute_name, options = {}, &block) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'lib/ckeditor/hooks/simple_form.rb', line 15

def ckeditor(attribute_name, options={}, &block)
  column     = find_attribute_column(attribute_name)
  input_type = default_input_type(attribute_name, column, options)

  if block_given?
    SimpleForm::Inputs::BlockInput.new(self, attribute_name, column, input_type, options, &block).render
  else
    CkeditorInput.new(self, attribute_name, column, input_type, options).render
  end
end