Sha256: a8189f42cc4ae6c0f80d2b92bd63bae37aaf691cce41a6877a6e3502a6456dad

Contents?: true

Size: 1.19 KB

Versions: 13

Compression:

Stored size: 1.19 KB

Contents

<%#
The following params are the variables that can be used in this partial.

@param form [Wallaby::FormBuilder] custom form object that adds a few helper methods and delegate missing methods to the view
@param object [Wallaby::ResourceDecorator] decorator instance which wraps the resource (e.g. ActiveRecord) instance
@param field_name [String] name of the field
@param value [Object] value of the field
@param metadata [Hash] metadata of the field
%>
<div class="form-group <%= form.error_class field_name %>">
  <%= form.label field_name, metadata[:label] %>
  <%= form.text_area field_name, class: 'form-control', data: { init: 'codemirror', mode: 'gfm' } %>
  <%= form.error_messages field_name %>
  <%= hint_of metadata %>
</div>

<% unless @codemirror_init %>
  <% @codemirror_init = true %>
  <% content_for :custom_javascript do %>
    <% javascript_tag do %>
      jQuery(document).off(readyPrefix('.codemirror_init')).on(readyPrefix('.codemirror_init'), function () {
        $('textarea[data-init="codemirror"]').each(function (index, element) {
          CodeMirror.fromTextArea(element, {
            mode: $(element).data('mode')
          });
        })
      })
    <% end %>
  <% end %>
<% end %>

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
wallaby-6.1.6 app/views/wallaby/resources/form/_markdown.html.erb
wallaby-6.1.5 app/views/wallaby/resources/form/_markdown.html.erb
wallaby-6.1.4 app/views/wallaby/resources/form/_markdown.html.erb
wallaby-6.1.3 app/views/wallaby/resources/form/_markdown.html.erb
wallaby-6.1.2 app/views/wallaby/resources/form/_markdown.html.erb
wallaby-6.1.1 app/views/wallaby/resources/form/_markdown.html.erb
wallaby-6.1.0 app/views/wallaby/resources/form/_markdown.html.erb
wallaby-6.0.2 app/views/wallaby/resources/form/_markdown.html.erb
wallaby-6.0.1 app/views/wallaby/resources/form/_markdown.html.erb
wallaby-5.1.8 app/views/wallaby/resources/form/_markdown.html.erb
wallaby-5.1.7 app/views/wallaby/resources/form/_markdown.html.erb
wallaby-5.1.6 app/views/wallaby/resources/form/_markdown.html.erb
wallaby-5.1.5 app/views/wallaby/resources/form/_markdown.html.erb