Skip to content
This repository has been archived by the owner on Nov 21, 2017. It is now read-only.

Commit

Permalink
タスク登録画面に「Category」項目を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
yohhatu committed Jan 10, 2012
1 parent 92ea8b3 commit 918448c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/helpers/tasks_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,12 @@ def links_for(task)
links << delete_link(task)
raw(links.join(" "))
end

def category_options
options = [ [ "----", nil ]]
Category.all.each do |c|
options << [c.name, c.id ]
end
options
end
end
3 changes: 3 additions & 0 deletions app/views/tasks/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
<% end %>
<ui>
<li><%= form.label :name %><%= form.text_field :name %></li>
<% if Category.all.present? %>
<li><%= form.label :category_id %><%= form.select :category_id, category_options %></li>
<% end %>
<li>
<%= form.label :due_date %>
<%= form.date_select :due_date, :use_month_numbers => true,
Expand Down

0 comments on commit 918448c

Please sign in to comment.