title: How do you create resource route when the item has optional child items?
body: <p>How do you create routes for models that have option child properties?  Say I am creating a help desk app, and the ticket could be associated with an order that the customer had previously had with me, or it could be regarding an item in the catalog they have not yet ordered.</p>
  
  <pre><code>class CustomerServiceTicket
    belongs_to :order
    belongs_to :item
    belongs_to :buyer
    belongs_to :customer_service_category
  end
  
  class Order
    ...
    has_one :customer_service_ticket
    ...
  end
  
  class Item
    ...
    has_one :customer_service_ticket
    ...
  end
  </code></pre>
  
  <p>in the schema for customer_service_ticket, order_id and item_id are nullable.</p>
  
  <p>So I'll have a 'create a customer service ticket' link next to their say their order_id's on the their closed orders page...and a similar link next to the item_id on the product catalog page.</p>
  
  <p>I'm thinking the url structure should look like this:</p>
  
  <p>customer_service_ticket/new/order/123</p>
  
  <p>for tickets created relating to an order</p>
  
  <p>and</p>
  
  <p>customer_service_ticket/new/item/789</p>
  
  <p>for tickets created relating to an item</p>
  
  <p>and just
  customer_service_ticket/new
  when there is neither (also valid for cases where the customer just has a general question)</p>
  
  <p>How would I structure the routes to be the most efficient?  I'm not married to that URL structure above, if there is a better way I'm happy to try it.</p>