named route (RESTful) for actions other than index, delete, create, and edit

Posted by Hadi on Stack Overflow See other posts from Stack Overflow or by Hadi
Published on 2010-06-10T02:53:33Z Indexed on 2010/06/10 3:03 UTC
Read the original article Hit count: 282

Filed under:
|

To illustrate:

class Customer
  has_many :sales_orders
end

class SalesOrder
  belongs_to :customer
end

i want to have customer to list sales_order which is ready to be sent, should i:

  1. put the routing http://.../sales_orders/can_be_delivered or
  2. create a new controller for reporting http://.../reports/sales_orders_can_be_delivered

for the 1st one, what should goes in the route.rb?

for the 2nd one, nothing goes in route.rb, we can use the last defined route which is :controller/:action.. <-- but this isn't named route

any ideas for this kind of problem?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about routing