This project is archived and is in readonly mode.
:as option not working as expected in new Rails 3 router DSL
-
Wincent Colaiuta
Can someone involved on the API design comment on this one? If I can just get some clarification on whether this is a doc bug, an implementation bug, or user error, then I can work on a fix.
-
Santiago Pastorino
- State changed from new to invalid
Wincent as changes the named route only i'm going to change the guides, thanks ;).
-
José Valim
- Milestone cleared.
- Assigned user set to José Valim
It's intended behavior. Although not consistent with the previous API, the new router API is consistent internally in a sense that:
- :path always changes the path
- :as always changed the named url helper
-
Wincent Colaiuta
Cool. :path does exactly what I want/need.
BTW I haven't seen the ":path" parameter mentioned anywhere. The official guide only mentions ":path_names", as does Yehuda's article.
-
José Valim
Yeah, the DSL was inconsistent and we fixed and added :path just in beta 3.
-
Wincent Colaiuta
Well, it certainly looks more consistent now. Good job on that. (In 2.3.5 I had a fairly ugly routes file, about 100 lines long. With the new DSL it's still almost the same length, but it's much clearer now and the amount of repetition and crud is greatly reduced.)
-
José Valim
Awesome, thanks for the feedback! :)