Skip to content

Commit

Permalink
allow common name to be modifiable via ui for plants
Browse files Browse the repository at this point in the history
  • Loading branch information
one-m1nd committed Mar 6, 2024
1 parent 92842d0 commit 39dfc10
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/plants_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ def set_plant

# Only allow a list of trusted parameters through.
def plant_params
params.require(:plant).permit([:name, :family_id, :genus_id, :status_id, :year_acquired])
params.require(:plant).permit([:name, :family_id, :genus_id, :status_id, :year_acquired, :common_name])
end
end
1 change: 1 addition & 0 deletions app/views/plants/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<% end %>
<%= form.text_field :name %>
<%= form.text_field :common_name %>
<%= collection_select(:plant, :family_id, Family.all.sort_by(&:name), :id, :name, prompt: true) %>
<%= collection_select(:plant, :genus_id, Genus.all.sort_by(&:name), :id, :name, prompt: true) %>
<%= collection_select(:plant, :status_id, Status.all, :id, :name, prompt: true) %>
Expand Down

0 comments on commit 39dfc10

Please sign in to comment.