-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html.erb
41 lines (35 loc) · 1.18 KB
/
index.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<h1>Listing tasks</h1>
<%= form_tag(nil, :method => :get) do %>
<%= label :search, :name %><%= text_field :search, :name %><br />
<%= label :search, :like_name %><%= text_field :search, :like_name %><br />
<% C.status.to_opt.each do |status| %>
<%= label :search, "status_#{status.first}" %><%= check_box_tag "search[status][]", status.last, !!@search.status ? @search.status.detect{|s| s == status.last} : false %>
<% end %><br />
<%= label :search, :price %><%= text_field :search, :from_price %><%= text_field :search, :to_price %><br />
<%= submit_tag :search %>
<% end %>
<table>
<thead>
<tr>
<th>Name</th>
<th>Status</th>
<th>Price</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<% @tasks.each do |task| %>
<tr>
<td><%= task.name %></td>
<td><%= C.status[task.status].name %></td>
<td><%= task.price %></td>
<td><%= link_to 'Show', project_task_path(:id => task.id) %></td>
<td><%#= link_to 'Edit', edit_task_path(task) %></td>
<td><%#= link_to 'Delete', task_path(task, :mode => "draft") %></td>
</tr>
<% end %>
</tbody>
</table>
<%= link_to 'New Task', new_project_task_path %>