Sha256: 2be899684ae7807007ee70836c23a42e1f6003ac27700bb4e61183d9157670e0

Contents?: true

Size: 680 Bytes

Versions: 4

Compression:

Stored size: 680 Bytes

Contents

<%#
# SimpleMarkdown Form Partial

This partial renders a WYSIWYG text area to help writing Markdown text

## Local variables:

- `f`:
  A Rails form generator, used to help create the appropriate input fields.
- `field`:
  An instance of Administrate::Field::SimpleMarkdown.
%>

<div class="field-unit__label">
  <%= f.label field.attribute %>
</div>
<div class="field-unit__field">
  <%= f.text_area field.attribute %>
</div>
<%= content_for :javascript do %>
  <script type="text/javascript">
    $(function() {
      new SimpleMDE({
        element: document.getElementById('<%= f.object.class.name.downcase %>_<%= field.attribute %>')
      });
    });
  </script>
<% end %>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
administrate-field-simple_markdown-0.1.0 app/views/fields/simple_markdown/_form.html.erb
administrate-field-simple_markdown-0.0.4 app/views/fields/simple_markdown/_form.html.erb
administrate-field-simple_markdown-0.0.3 app/views/fields/simple_markdown/_form.html.erb
administrate-field-simple_markdown-0.0.2 app/views/fields/simple_markdown/_form.html.erb