Sha256: 27f72347d9efb36df3245e0358189ae6366ddba507adea37174984a6d7fc8f61

Contents?: true

Size: 896 Bytes

Versions: 2

Compression:

Stored size: 896 Bytes

Contents

= effective_form_with(model: post, url: post.persisted? ? effective_posts.post_path(post.id) : effective_posts.posts_path) do |f|
  = f.text_field :title, hint: 'The title of your post.'

  - if Array(EffectivePosts.categories).length > 1
    = f.select :category, EffectivePosts.categories
  - else
    = f.hidden_field :category, (EffectivePosts.categories.first || 'posts')

  = render partial: '/effective/posts/additional_fields', locals: { post: post, form: f, f: f }

  = f.datetime_field :published_at, label: 'Publish date', hint: 'When should this be displayed on the website.'

  = f.text_area :body

  / = f.input :body,
  /   as: (defined?(EffectiveFormInputs) ? :effective_ckeditor_text_area : :text),
  /   hint: 'The body of your post. You can add content here, or with the full screen editor on the next page.',
  /   toolbar: 'simple',
  /   required: true

  = f.submit 'Save'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
effective_posts-1.0.1 app/views/effective/posts/_form.html.haml
effective_posts-1.0.0 app/views/effective/posts/_form.html.haml