mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-18 21:56:55 -04:00
Added crop wrangling hints to crops form.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
= form_for @crop do |f|
|
||||
= 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:"
|
||||
@@ -6,11 +6,21 @@
|
||||
- @crop.errors.full_messages.each do |msg|
|
||||
%li= msg
|
||||
|
||||
.field
|
||||
= f.label :system_name
|
||||
= f.text_field :system_name
|
||||
.field
|
||||
= f.label :en_wikipedia_url
|
||||
= f.text_field :en_wikipedia_url
|
||||
.actions
|
||||
= f.submit 'Save'
|
||||
%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.
|
||||
.form-actions
|
||||
= f.submit 'Save', :class => 'btn btn-primary'
|
||||
|
||||
@@ -10,7 +10,6 @@ describe "crops/new" do
|
||||
end
|
||||
|
||||
it "renders new crop form" do
|
||||
render
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "form", :action => crops_path, :method => "post" do
|
||||
assert_select "input#crop_system_name", :name => "crop[system_name]"
|
||||
@@ -18,4 +17,8 @@ describe "crops/new" do
|
||||
end
|
||||
end
|
||||
|
||||
it "shows a link to crop wrangling guidelines" do
|
||||
assert_select "a[href^=http://wiki.growstuff.org]", "crop wrangling guide"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user