Growstuff/growstuff

View on GitHub
app/views/forums/_form.html.haml

Summary

Maintainability
Test Coverage
.card.col-md-8.col-lg-7.mx-auto.float-none.white.z-depth-1.py-2.px-2
  .card-header
    - if content_for? :title
      %h1.h2-responsive.text-center
        %strong=yield :title
  = bootstrap_form_for(@forum) do |f|
    .card-body
      - if @forum.errors.any?
        #error_explanation
          %h2
            = pluralize(@forum.errors.size, "error")
            prohibited this forum from being saved:
          %ul
            - @forum.errors.full_messages.each do |msg|
              %li= msg

      = f.text_field :name, required: true
      = f.text_area :description, rows: 6, required: true
      = f.select(:owner_id, Member.all.order(:login_name).pluck(:login_name, :id), required: true)
    .card-footer
      .text-right= f.submit 'Save'