Prevent generators from creating controllers which are reserved by Rails #1880

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Contributor

neilmiddleton commented Jun 28, 2011

As discussed here: #1836 (comment)

This is a first (and probably bad attempt) at implementing this, at least in a way that will stop people making controllers with reserved names.

I would guess that the list of reserved names isn't complete, but this is all I could see from the routes. If there are others, feel free to mess.

Contributor

josevalim commented Jun 28, 2011

The patch looks good but we don't have an AssetsController inside Rails. Neither properties. Only Rails::Info::Properties which honestly is quite unexpected to be overridden by someone.

Contributor

neilmiddleton commented Jun 28, 2011

Ah, could this be a 3.1.0.rc issue then? I created an AssetsController quite happily the other day, which then led to all sorts of issues inside my app which was using the assets pipeline.

Contributor

josevalim commented Jun 28, 2011

Probably:

Loading development environment (Rails 3.1.0.rc4)
ree-1.8.7-2010.02 > AssetsController
NameError: uninitialized constant AssetsController
from (irb):1

@josevalim josevalim closed this Jun 28, 2011

Contributor

neilmiddleton commented Jun 28, 2011

Ah, interesting. I found that when I'd created said AssetsController, JS and CSS stopped working. Possibly a routing issue then.

Contributor

josevalim commented Jun 28, 2011

Ah yes. In rc1., if you defined an /assets route it would have higher priority than rails assets one. Today the rails assets one has higher priority.

jake3030 pushed a commit to jake3030/rails that referenced this pull request Jun 28, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment