Sha256: c24c81778bb080b4824bb182f2ac318f95125c4cfae033e43fa193c3d5c9b3b5

Contents?: true

Size: 813 Bytes

Versions: 7

Compression:

Stored size: 813 Bytes

Contents

<%= f.label a, class: "form-control-label #{required?(f.object, a) ? 'required' : ''}"%>
<%= f.text_area a, class: "form-control #{'jsonarea_' + f.object.class.to_s + '_' + a.to_s}", required: required?(f.object, a) %>

<script src="https://rawgithub.com/zaach/jsonlint/79b553fb65c192add9066da64043458981b3972b/lib/jsonlint.js"></script>
<script type="text/javascript">
  var jsonarea_<%= f.object.class.to_s + '_' + a.to_s %> = document.getElementsByClassName("jsonarea_<%= f.object.class.to_s + '_' + a.to_s %>")[0];
  var editor_jsonarea_<%= f.object.class.to_s + '_' + a.to_s %> = CodeMirror.fromTextArea(jsonarea_<%= f.object.class.to_s + '_' + a.to_s %>, {
    lineNumbers: true,
    theme: 'relax-seti',
    mode: "application/json",
    gutters: ["CodeMirror-lint-markers"],
    lint: true
  });
</script>

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
slash_admin-1.0.5 app/views/slash_admin/fields/_jsonb.html.erb
slash_admin-1.0.4 app/views/slash_admin/fields/_jsonb.html.erb
slash_admin-1.0.3 app/views/slash_admin/fields/_jsonb.html.erb
slash_admin-1.0.2 app/views/slash_admin/fields/_jsonb.html.erb
slash_admin-1.0.1 app/views/slash_admin/fields/_jsonb.html.erb
slash_admin-1.0 app/views/slash_admin/fields/_jsonb.html.erb
slash_admin-0.1.0 app/views/slash_admin/fields/_json.html.erb