DigitalNZ/plug

View on GitHub
app/views/plug/features/_form.html.haml

Summary

Maintainability
Test Coverage
= form_for @feature do |f|
  - if @feature.errors.any?
    #error_explanation
      %h2= "#{pluralize(@feature.errors.count, "error")} prohibited this feature from being saved:"
      %ul
        - @feature.errors.full_messages.each do |message|
          %li= message

  .field
    = f.label :name
    = f.text_field :name
  .field
    = f.label :description
    = f.text_area :description, rows: 5
  .field
    = f.label :notice
    = f.text_area :notice, rows: 10
  .field
    = f.label :state
    = f.select :state, ['enabled', 'disabled']
  .actions.clearfix
    .float-left
      = link_to 'Back', features_path, class: 'button'
    .float-right
      = f.submit 'Save'