stevegrossi/stevegrossi

View on GitHub
app/views/meta/posts/_form.html.slim

Summary

Maintainability
Test Coverage
= flash_errors(@post)
= simple_form_for([:meta, @post]) do |f|
  = f.input :title, hint: 'For book posts, defaults to book’s title'
  = f.association :book, collection: Book.all.order(:title), input_html: { data: { placeholder: 'Select book' } }
  = f.input :link_url
  = f.input :idea, input_html: { rows: 4 }
  = f.input :content
  = f.input :published_at, include_blank: true
  = f.association :tags

  div.actions
    = f.submit 'Publish'
    = f.submit @post.published? ? 'Unpublish' : 'Save Draft', class: :secondary
    = link_to 'or go back', meta_posts_path, class: :cancel