Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I can understand why Craig missed that actually. It's such a subtle difference it didn't even cross my mind. The only thing that tipped me off is that my named routes for the singleton resource has a weird index name: <code>user_foo_index</code> instead of <code>user_foos</code>.</p> <p>It's a really smart deduction from the absence of plural on the part of Rails.</p> <p><strong>Warning:</strong> The following examples use <em>shallow nesting</em> by either doing this:</p> <pre><code>resources :cats, shallow: true do resources :noms end </code></pre> <p>Or that:</p> <pre><code>resources :cats do shallow do resources :noms end end </code></pre> <p>Anyway back to business, if you setup a singular resource – <code>address</code> as opposed to <code>articles</code> for instance – and you see something like this:</p> <pre><code>user_address_index GET | POST new_user_address GET edit_address GET address GET | PUT | DELETE </code></pre> <p>Then as Andreas justly pointed out, you probably incorrectly declared this in your routes:</p> <pre><code>resources :users do resources :address end </code></pre> <p>And if you change that to:</p> <pre><code>resources :users do resource :address end </code></pre> <p>You should be all fine and happy and see something like this if you punch <code>rake routes</code> in your prompt:</p> <pre><code> user_address POST | GET | PUT | DELETE new_user_address GET edit_user_address GET </code></pre> <p>Note: I know the output of rakes routes doesn't look exactly like this (it's a lot more verbose), I'm just simplifying for the sake of focus.</p> <p>Hope that helps.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload