Skip to content

Commit

Permalink
allow year_acquired to be modifiable via ui
Browse files Browse the repository at this point in the history
  • Loading branch information
one-m1nd committed Mar 5, 2024
1 parent 6a4584a commit fbb5d17
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])
params.require(:plant).permit([:name, :family_id, :genus_id, :status_id, :year_acquired])
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 @@ -15,6 +15,7 @@
<%= 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) %>
<%= number_field(:plant, :year_acquired, in: (2017..2050)) %>

<div class="inline">
<%= form.submit class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium cursor-pointer" %>
Expand Down

0 comments on commit fbb5d17

Please sign in to comment.