Advertisement
|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| 06/27/2008 at 07:55PM PDT, ID: 23523418 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
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: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: |
tasks_controller.rb
class TasksController < ApplicationController
def completed
@tasks = Task.find(:all, :conditions => 'completed IS NOT NULL')
end
All other controller here ...
end
routes.rb
ActionController::Routing::Routes.draw do |map|
map.resources :tasks, :collection => { :completed => :get }
map.root :controller => "tasks"
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
end
tasks/completed.rhtml.erb
<h1>Listing tasks</h1>
<% for task in @tasks %>
<ul>
<li><%=h task.name %> <%= link_to 'Show', task %> | <%= link_to 'Edit', edit_task_path(task) %> | <%= link_to 'Destroy', task, :confirm => 'Are you sure?', :method => :delete %></li>
</ul>
<% end %>
<br />
<%= link_to 'New task', new_task_path %>
The results of running 'rake routes':
(in /Users/Darin/todo)
completed_tasks GET /tasks/completed {:action=>"completed", :controller=>"tasks"}
formatted_completed_tasks GET /tasks/completed.:format {:action=>"completed", :controller=>"tasks"}
tasks GET /tasks {:action=>"index", :controller=>"tasks"}
formatted_tasks GET /tasks.:format {:action=>"index", :controller=>"tasks"}
POST /tasks {:action=>"create", :controller=>"tasks"}
POST /tasks.:format {:action=>"create", :controller=>"tasks"}
new_task GET /tasks/new {:action=>"new", :controller=>"tasks"}
formatted_new_task GET /tasks/new.:format {:action=>"new", :controller=>"tasks"}
edit_task GET /tasks/:id/edit {:action=>"edit", :controller=>"tasks"}
formatted_edit_task GET /tasks/:id/edit.:format {:action=>"edit", :controller=>"tasks"}
task GET /tasks/:id {:action=>"show", :controller=>"tasks"}
formatted_task GET /tasks/:id.:format {:action=>"show", :controller=>"tasks"}
PUT /tasks/:id {:action=>"update", :controller=>"tasks"}
PUT /tasks/:id.:format {:action=>"update", :controller=>"tasks"}
DELETE /tasks/:id {:action=>"destroy", :controller=>"tasks"}
DELETE /tasks/:id.:format {:action=>"destroy", :controller=>"tasks"}
root / {:action=>"index", :controller=>"tasks"}
/:controller/:action/:id
/:controller/:action/:id.:format
|