Files
growstuff/app/views/crops/_form.html.haml
2013-05-14 23:24:06 +10:00

32 lines
1.3 KiB
Plaintext

= form_for @crop, :html => {:class => 'form-horizontal'} do |f|
- if @crop.errors.any?
#error_explanation
%h3= "#{pluralize(@crop.errors.count, "error")} prohibited this crop from being saved:"
%ul
- @crop.errors.full_messages.each do |msg|
%li= msg
%p
%span.help-block
For detailed crop wrangling guidelines, please consult the
=link_to "crop wrangling guide", "http://wiki.growstuff.org/index.php/Crop_wrangling"
on the Growstuff wiki.
.control-group
= f.label :system_name, :class => 'control-label'
.controls
= f.text_field :system_name
%span.help-inline Name in US English; singular; capitalize proper nouns only.
.control-group
= f.label :en_wikipedia_url, 'Wikipedia URL', :class => 'control-label'
.controls
= f.text_field :en_wikipedia_url
%span.help-inline Link to this crop's page on the English language Wikipedia.
.control-group
= f.label :parent_id, 'Parent crop', :class => 'control-label'
.controls
= collection_select(:crop, :parent_id, Crop.all, :id, :system_name, {:include_blank => true})
%span.help-inline Optional. For setting up crop hierarchies for varieties etc.
.form-actions
= f.submit 'Save', :class => 'btn btn-primary'