Answer the question
In order to leave comments, you need to log in
How to properly prioritize a task?
Decided to break the question How to make the "status" for the task? into two separate ones.
There are tasks - objects of the Task model. Tasks can have different priorities - "None", "High", "Medium", "Low".
So far done like this:
Added "priority" field
create_table "tasks", force: :cascade do |t|
t.integer "priority"
end
<%= simple_form_for @task do |f| %>
<%= f.input :priority, collection: , selected: ["None"] %>
<% end %>
Answer the question
In order to leave comments, you need to log in
Create another table for priorities and load names into collection from there - this will make it possible to add / change priorities (values) without interfering with the application structure.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question