I feel that `only: []` definitely is not an intuitive approach that shows 
what you would be trying to achieve in that instance. 

Also, I believe your only current alternative would be writing out your 
resourcing 'longhand' outside of an actual resources block in your 
`routes.rb`, correct? (I have seen all too many apps bloat with a lot of 
handscrawled routes)

But since this is a bit aways from normal `resources` namespace usage maybe 
your alias ought to go all the way up to `resources` itself.... such as:

```
resources_without_crud :users do
  ...
end
```

When I think of `resources` I think of the crud rails magic, and maybe it 
would help to make that even more explicit. Very interesting thought and 
thank you for raising it.



On Wednesday, January 17, 2018 at 11:43:41 PM UTC, François Belle wrote:
>
> I would like to propose a feature that would be kind of an alias for 
>
> resources :users, only: [] do
>   ...
> end
>
> I thinks it's weird to have to specify an empty array when we need a 
> resourceful route without the default CRUD generated along.
>
> It would allow us to use it like the shallow feature 
> <https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/routing/mapper.rb#L1372>
> :
>
> resources :users, without_crud: true do
>   get :unsubscribe, on: :collection
>   get :foo
>   post :bar
> end
>
> And generate only:
>
> GET /users/unsubscribe
> GET /users/:id/foo
> POST /users/:id/bar
>
>
> Any feedback would be greatly appreciated, thank you guys!
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to