mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-01-28 19:21:00 -05:00
33 lines
1012 B
Plaintext
33 lines
1012 B
Plaintext
= form_for(@post, html: { role: "form" }) do |f|
|
|
- if @post.errors.any?
|
|
#error_explanation
|
|
%h2
|
|
= pluralize(@post.errors.size, "error")
|
|
prohibited this post from being saved:
|
|
%ul
|
|
- @post.errors.full_messages.each do |msg|
|
|
%li= msg
|
|
|
|
.form-group
|
|
= label_tag :post, "Subject", class: 'control-label'
|
|
= f.text_field :subject, class: 'form-control', autofocus: 'autofocus', maxlength: 255
|
|
|
|
.form-group
|
|
- if @post.forum || @forum
|
|
= label_tag :body, "What's up?", class: 'control-label'
|
|
- else
|
|
= label_tag :body, "What's going on in your food garden?"
|
|
= f.text_area :body, rows: 12, class: 'form-control'
|
|
%span.help-block
|
|
= render partial: "shared/markdown_help"
|
|
|
|
- if @post.forum || @forum
|
|
- forum = @post.forum || @forum
|
|
%p
|
|
This post will be posted in the forum
|
|
= link_to forum.name, forum
|
|
.field
|
|
= f.hidden_field :forum_id, value: forum.id
|
|
|
|
= f.submit "Post", class: 'btn btn-primary'
|