Files
growstuff/app/views/forums/_form.html.haml
Cjay Billones bb88041fef [Refactoring] Replace .count and .length with .size for collections
Improved program efficiency (in querying in particular) by replacing .count and .length with .size for collections.

Fix error in refactoring

Reverted some .size into .count
2015-06-25 12:09:03 +08:00

24 lines
912 B
Plaintext

= form_for @forum, :html => { :class => 'form-horizontal', :role => "form" } do |f|
- 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
.form-group
= f.label :name, :class => 'control-label col-md-2'
.col-md-8
= f.text_field :name, :class => 'form-control'
.form-group
= f.label :description, :class => 'control-label col-md-2'
.col-md-8
= f.text_area :description, :rows => 6, :class => 'form-control'
.form-group
= f.label :owner_id, :class => 'control-label col-md-2'
.col-md-8
= collection_select(:forum, :owner_id, Member.all, :id, :login_name, {}, :class => 'form-control')
.form-group
.form-actions.col-md-offset-2.col-md-8
= f.submit 'Save', :class => 'btn btn-primary'