Sha256: 633e9d85120be0396b64f3e75de854858875fa74b5f9062acf75bd8e7d20bb18

Contents?: true

Size: 681 Bytes

Versions: 1

Compression:

Stored size: 681 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_field 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

1 entries across 1 versions & 1 rubygems

Version Path
administrate-field-simple_markdown-0.0.1 app/views/fields/simple_markdown/_form.html.erb