Sha256: 9fc6b980075ac8ba5608ecae5a69725c300e68e9f1d6cfd43b4ab65f32f19769

Contents?: true

Size: 1.51 KB

Versions: 10

Compression:

Stored size: 1.51 KB

Contents

<%
  # headmin/forms/ckeditor
  #
  # ==== Options
  # * <tt>form<tt> - Form object
  # * <tt>attribute<tt> - Name of the attribute of the form model
  # * <tt>label<tt> - Text to show as label. Label will be hidden if value is false
  # * <tt>toolbar<tt> - Array containing the toolbar items to display
  # * <tt>upload_path<tt> - URL to upload images to
  #
  # ==== Examples
  #   Basic version
  #   <%= render 'headmin/forms/textarea', form: form, attribute: :title %#>

  class_names = local_assigns.has_key?(:class) ? local_assigns[:class] : false
  data = local_assigns.has_key?(:data) ? data : {}
  disabled = local_assigns.has_key?(:disabled) ? disabled : false
  label = local_assigns.has_key?(:label) ? label : nil
  readonly = local_assigns.has_key?(:readonly) ? readonly : false
  required = local_assigns.has_key?(:required) ? required : false
  toolbar = local_assigns.has_key?(:toolbar) ? toolbar : nil
  upload_path = local_assigns.has_key?(:upload_path) ? upload_path : ''

  data = data.merge(
    'ckeditor-toolbar': toolbar,
    'ckeditor-upload-path': upload_path
  )

  options = {
    'aria-describedby': form_field_validation_id(form, attribute),
    class: "ckeditor #{form_field_validation_class(form, attribute)} #{class_names}",
    data: data,
    disabled: disabled,
    placeholder: attribute,
    readonly: readonly,
    required: required,
  }
%>

<%= render 'headmin/forms/base', form: form, attribute: attribute, label: label, required: required do |form| %>
  <%= form.text_area(attribute, options) %>
<% end %>

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
headmin-0.2.9 app/views/headmin/forms/_ckeditor.html.erb
headmin-0.2.8 app/views/headmin/forms/_ckeditor.html.erb
headmin-0.2.7 app/views/headmin/forms/_ckeditor.html.erb
headmin-0.2.6 app/views/headmin/forms/_ckeditor.html.erb
headmin-0.2.5 app/views/headmin/forms/_ckeditor.html.erb
headmin-0.2.4 app/views/headmin/forms/_ckeditor.html.erb
headmin-0.2.3 app/views/headmin/forms/_ckeditor.html.erb
headmin-0.2.2 app/views/headmin/forms/_ckeditor.html.erb
headmin-0.2.1 app/views/headmin/forms/_ckeditor.html.erb
headmin-0.2.0 app/views/headmin/forms/_ckeditor.html.erb