The thing about the semicolon is how nicely it played with to_param''d resource identifiers. Take this: map.resources :users And a to_param on User: class User < ActiveRecord::Base alias_attribute :to_param, :name end And a find_by_name in our UsersController. Now we get /users/chris and /users/chris/edit as expected. Works great. But what about our ''Popular Members'' page? /users/popular? Major namespace clash, now and in the future (when we add new features). This is a shame because Rails makes it so easy to use a name (or title) as the resource identifier. Has anyone run into this issue and is there a sanctioned way to handle it? I''d ask for the semicolon back, but I doubt that''ll happen. - Chris --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Why was the semicolon removed? -- Thank you, Steven A Bristol --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On 7/31/07, Chris Wanstrath <chris@ozmm.org> wrote:> > > Now we get /users/chris and /users/chris/edit as expected. Works > great. But what about our ''Popular Members'' page? /users/popular? > Major namespace clash, now and in the future (when we add new > features).What about reverting to using the semicolon when the resource in question has an explicit to_param method? It''s very easy to check whether the method has been defined and this shouldn''t cause any url breakage. I''m about to face this situation myself and I''d really like to fine a clean solution. ::Jack Danger --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
> Why was the semicolon removed?Doesn''t work with page caching, safari has bugs with authentication with urls with semi colons in it. Various libraries (like mongrel) mistakenly consider ; to be part of the query string. Overall it simply wasn''t worth the theoretical ''peers in the hierarchy'' benefit that we put it in for. -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
May be we need something like /users/populars ( notice plural ) to force going to collection method. May be. On 8/1/07, Michael Koziarski <michael@koziarski.com> wrote:> > > Why was the semicolon removed? > > Doesn''t work with page caching, safari has bugs with authentication > with urls with semi colons in it. Various libraries (like mongrel) > mistakenly consider ; to be part of the query string. > > Overall it simply wasn''t worth the theoretical ''peers in the > hierarchy'' benefit that we put it in for. > > -- > Cheers > > Koz > > > >-- Cheers! - Pratik http://m.onkey.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
> May be we need something like /users/populars ( notice plural ) to > force going to collection method. May be.Routes would still match in that situation. -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Naah..my above post doesn''t make sense. May be /users/popular?collection should force going to collection method. So if you do something like : popular_users_url(:force_collection => true) - it should generate the above url. On 8/1/07, Pratik <pratiknaik@gmail.com> wrote:> May be we need something like /users/populars ( notice plural ) to > force going to collection method. May be. > > On 8/1/07, Michael Koziarski <michael@koziarski.com> wrote: > > > > > Why was the semicolon removed? > > > > Doesn''t work with page caching, safari has bugs with authentication > > with urls with semi colons in it. Various libraries (like mongrel) > > mistakenly consider ; to be part of the query string. > > > > Overall it simply wasn''t worth the theoretical ''peers in the > > hierarchy'' benefit that we put it in for. > > > > -- > > Cheers > > > > Koz > > > > > > > > > > > -- > Cheers! > - Pratik > http://m.onkey.org >-- Cheers! - Pratik http://m.onkey.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
> Naah..my above post doesn''t make sense. > > May be /users/popular?collection should force going to collection > method. So if you do something like : > > popular_users_url(:force_collection => true) - it should generate the above url.Sounds a little too tricky for my liking. What we really want is a way for people to provide a prefix for their collection actions so that we can distinguish these two cases /users/the-prefix/popular /users/mr-popular -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Chris, It''s not the most elegant solution (though only one line) but the following should work, no? map.connect ''users/:action'', :controller => ''users'', :requirements => { :action => %w(popular unpopular reallybadass) } map.resources :users Zack On 7/31/07, Michael Koziarski <michael@koziarski.com> wrote:> > > Naah..my above post doesn''t make sense. > > > > May be /users/popular?collection should force going to collection > > method. So if you do something like : > > > > popular_users_url(:force_collection => true) - it should generate the above url. > > Sounds a little too tricky for my liking. What we really want is a > way for people to provide a prefix for their collection actions so > that we can distinguish these two cases > > /users/the-prefix/popular > /users/mr-popular > > > -- > Cheers > > Koz > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Hey, Wouldn''t a simpler, and clearer, solution be to simply admit that using the subordinate namespace of "/users" for things other than user identities is a bad idea? My first reaction would be to put the "report on users, ordered by popularity" into /user_reports/popularity and be done with it. Of course, I am biased - I''m presently on a major separation-of- concerns kick that''s arisen from seeing too many ''canned-report'' actions rammed into controllers. Just my 2c... Trev On 31-Jul-07, at 4:44 PM, Michael Koziarski wrote:> >> Naah..my above post doesn''t make sense. >> >> May be /users/popular?collection should force going to collection >> method. So if you do something like : >> >> popular_users_url(:force_collection => true) - it should generate >> the above url. > > Sounds a little too tricky for my liking. What we really want is a > way for people to provide a prefix for their collection actions so > that we can distinguish these two cases > > /users/the-prefix/popular > /users/mr-popular > > > -- > Cheers > > Koz > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On Aug 1, 2007, at 12:59 AM, Chris Wanstrath wrote:> > Has anyone run into this issue and is there a sanctioned way to handle > it? I''d ask for the semicolon back, but I doubt that''ll happen.Oh no, please don''t bring the semicolon back. Maybe we can add something to routing to make it easier to use an alternative to the resource name for the route. For intance, a solution might look like this. map.resources :users, :name_prefix => ''u'' map.nice_user ''users/:id'', :controller => ''users'', :method => ''show'' Which would create routes for: /users/chris /u/1/edit /u/12 Manfred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On Jul 31, 4:44 pm, "Michael Koziarski" <mich...@koziarski.com> wrote:> Sounds a little too tricky for my liking. What we really want is a > way for people to provide a prefix for their collection actions so > that we can distinguish these two cases > > /users/the-prefix/popular > /users/mr-popularI''ve used this before and it seems to make sense: /users/all/popular /users/mr-popular cheers, kampers --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On 01/08/07, Chris Kampmeier <ChrisGKampmeier@gmail.com> wrote:> > On Jul 31, 4:44 pm, "Michael Koziarski" <mich...@koziarski.com> wrote: > > Sounds a little too tricky for my liking. What we really want is a > > way for people to provide a prefix for their collection actions so > > that we can distinguish these two cases > > > > /users/the-prefix/popular > > /users/mr-popular > > I''ve used this before and it seems to make sense: > > /users/all/popular > /users/mr-popularAm I horribly misguided in wanting to use plural and singular prefixes to distinguish between collections and individual entities?: Collections: /posts/tagged/ruby /posts/from/2007/12 /posts/written-by/tomafro /users Individual items: /user/tomafro /post/1 Tom --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
I fully appreciate the semicolon issues that Koz referenced, mostly having to do with client and server incompatibilities. That being said, I loved the semicolon. It not only removed likely namespace collisions, but clearly defined the role for each part of the RESTful url: /resource.format;non-http-action?params In fact I had actually been hoping it would be embraced further, using that format for ''new'' as well: /users;new /users.xml;new So, is there any way we could use another character that would not cause these incompatibilities? According to RFC1738 (http://www.ietf.org/rfc/ rfc1738.txt) Thus, only alphanumerics, the special characters "$-_.+!*''(),", and reserved characters used for their reserved purposes may be used unencoded within a URL. Would it be possible for us to simply replace the semicolon with the + character? Or wrap the action in parentheses, ala wikipedia? Just my two cents. Tammer Saleh Thoughtbot, inc. tsaleh@thoughtbot.com On Aug 1, 7:17 am, "Tom Ward" <t...@popdog.net> wrote:> On 01/08/07, Chris Kampmeier <ChrisGKampme...@gmail.com> wrote: > > > > > On Jul 31, 4:44 pm, "Michael Koziarski" <mich...@koziarski.com> wrote: > > > Sounds a little too tricky for my liking. What we really want is a > > > way for people to provide a prefix for their collection actions so > > > that we can distinguish these two cases > > > > /users/the-prefix/popular > > > /users/mr-popular > > > I''ve used this before and it seems to make sense: > > > /users/all/popular > > /users/mr-popular > > Am I horribly misguided in wanting to use plural and singular prefixes > to distinguish between collections and individual entities?: > > Collections: > > /posts/tagged/ruby > /posts/from/2007/12 > /posts/written-by/tomafro > /users > > Individual items: > > /user/tomafro > /post/1 > > Tom--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On 8/1/07, Tom Ward <tom@popdog.net> wrote:> Am I horribly misguided in wanting to use plural and singular prefixes > to distinguish between collections and individual entities?: > > Collections: > > /posts/tagged/ruby > /posts/from/2007/12 > /posts/written-by/tomafro > /users > > Individual items: > > /user/tomafro > /post/1I love this. If I manage to pluginize it this week, I will let you know. -- Chris Wanstrath http://errfree.com // http://errtheblog.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On 1-Aug-07, at 4:17 AM, Tom Ward wrote:> > Am I horribly misguided in wanting to use plural and singular prefixes > to distinguish between collections and individual entities?: >Tom, I don''t think it''s horribly misguided - it''s an idea that''s been chucked around quite a lot and iirc the source of some disagreement. While it does solve the issue at hand, it has a couple of negative side-effects (for me anyhow). Namely, I like my URLs to be ''hackable'' in that users should be able to lop off the ''tomafro'' from: /users/tomafro and get a list of users. Splitting up the singular vs plural either breaks that or (if you allow /user to refer to the collection as well) re-introduces the same ambiguity. There''s also the issue of what a url looks like for an uncountable name - right now the impact of an uncountable resource name is hidden from the user (:singular => ''fish_instance'' for example). Under your scheme that would be exposed in the URL. On balance, I''m not a fan of the strategy. Trev> Collections: > > /posts/tagged/ruby > /posts/from/2007/12 > /posts/written-by/tomafro > /users > > Individual items: > > /user/tomafro > /post/1 > > Tom > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On 8/1/07, Tammer Saleh <tsaleh@gmail.com> wrote:> > > ..... > > Would it be possible for us to simply replace the semicolon with the + >character? Does anyone know of any technical obstacles to this approach? While I''m no fan of constantly changing an api this seems to me to be the best solution proposed so far. Koz, any thoughts on whether ''+'' would solve the problems that '';'' couldn''t? ::Jack Danger --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On 8/1/07, Tom Ward <tom@popdog.net> wrote:> Collections: > > /posts/tagged/ruby > /posts/from/2007/12 > /posts/written-by/tomafro > /users > > Individual items: > > /user/tomafro > /post/1For anyone interested: http://pastie.caboo.se/84170 Tested on 1.2.3, not sure about edge (but probably works). -- Chris Wanstrath http://errfree.com // http://errtheblog.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
I would like to use ! rather than +. I think it''s cooler and looks prettier next to the question mark. Plus the bang is kind of an action mark. http://blah.com/users/1!do_it?got_the_stuff=1 -- Thank you, Steven A Bristol --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
> Koz, any thoughts on whether ''+'' would solve the problems that '';'' couldn''t?It''s still likely to clash, as + could easily be returned from .to_param. I don''t believe there''s a nice, generic solution to this problem. -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On 8/1/07, Jack Danger Canty <dangeronrails@gmail.com> wrote:> > > On 8/1/07, Tammer Saleh <tsaleh@gmail.com> wrote: > > > > ..... > > > > Would it be possible for us to simply replace the semicolon with the + > > > > character? > > Does anyone know of any technical obstacles to this approach? While I''m no > fan of constantly changing an api this seems to me to be the best solution > proposed so far. > > Koz, any thoughts on whether ''+'' would solve the problems that '';'' couldn''t? >According to the standard encoding rules for URIs (and often applied in front-end web servers or intermediary proxies), ''+'' would get mapped to a space character ... likely not what you really wanted. Of course, the initial Rails use of '';'' for this was problematic as well, since that character is reserved for delimiting the start of path parameters (specific to a path element in between slashes, as opposed to request parameters that come after a ''?'' character). Personally, I think the current edge approach (using a ''/'') is the best alternative with current browsers.> ::Jack DangerCraig McClanahan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
I''m a fan of the singular vs. plural thing. It makes sense to me and while it''s true that it doesn''t hold up the "each level of the url must be meaningful", very few apps do. As for the uncountability thing, I wonder how many people actually use uncountable names as resources. Also, the routing could force devs to disambiguate when given an uncountable resource name. -bd On Aug 1, 2:24 pm, "Chris Wanstrath" <ch...@ozmm.org> wrote:> On 8/1/07, Tom Ward <t...@popdog.net> wrote: > > > Collections: > > > /posts/tagged/ruby > > /posts/from/2007/12 > > /posts/written-by/tomafro > > /users > > > Individual items: > > > /user/tomafro > > /post/1 > > For anyone interested:http://pastie.caboo.se/84170 > > Tested on 1.2.3, not sure about edge (but probably works). > > -- > Chris Wanstrathhttp://errfree.com//http://errtheblog.com--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
> Am I horribly misguided in wanting to use plural and singular prefixes > to distinguish between collections and individual entities?: > > Collections: > > /posts/tagged/ruby > /posts/from/2007/12 > /posts/written-by/tomafro > /users > > Individual items: > > /user/tomafro > /post/1At one time I would''ve agreed with you on this, but I''ve come to admire the way rails URL''s are "hackable" by default. That is, you can hack off the end of the URL, and more often than not you''re able to move to a higher level of the hierarchy. I believe good websites and web apps should have short, easy to read, hackable URLs. Here''s an article from Jakob Neilsen about how URLs are a strong part of the user interface, and why it makes sense to pay attention to them: URL as UI: http://www.useit.com/alertbox/990321.html I''ve heard all the standard REST arguments about URLs needing to be opaque, but I do believe that some users (myself included) rely on them to be "hackable". In fact I tend to directly manipulate the URL more than clicking on links in breadcrumbs or other navigation on web pages. -- Thanks, Dan __________________________________________________________________ Dan Kubb Autopilot Marketing Inc. Email: dan.kubb@autopilotmarketing.com Phone: 1 (604) 820-0212 Web: http://autopilotmarketing.com/ __________________________________________________________________ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Dan Kubb wrote:>> Am I horribly misguided in wanting to use plural and singular prefixes >> to distinguish between collections and individual entities?: >> >> Collections: >> >> /posts/tagged/ruby >> /posts/from/2007/12 >> /posts/written-by/tomafro >> /users >> >> Individual items: >> >> /user/tomafro >> /post/1 > > At one time I would''ve agreed with you on this, but I''ve come to admire > the way rails URL''s are "hackable" by default. That is, you can hack > off > the end of the URL, and more often than not you''re able to move to a > higher level of the hierarchy. I believe good websites and web apps > should have short, easy to read, hackable URLs. > > Here''s an article from Jakob Neilsen about how URLs are a strong part > of the user interface, and why it makes sense to pay attention to them: > URL as UI: http://www.useit.com/alertbox/990321.html > > I''ve heard all the standard REST arguments about URLs needing to be > opaque, > but I do believe that some users (myself included) rely on them to be > "hackable". In fact I tend to directly manipulate the URL more than > clicking on links in breadcrumbs or other navigation on web pages. >Amen. URLs are *very* important... something that the Rails community embraced from the beginning, but now seems to have lost a bit in the pursuit of the RESTful golden hammer. I break out of the typical Rails url-scheme at least a few times on every app I write. I choose URLs that will make sense to the user (or at least make sense to the stakeholder). The semi-colon was always completely wrong and jarring to me (and caused difficulties with at least one stakeholder) and I for one danced a jig of jubilation on the news of its imminent demise. My $.02. Ben --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Having URLs that are hackable are a good thing I definitely agree. I believe just because a user hacks a URL then that URL has to exist per se. A redirect to the plural version may be a sufficient fix. /users/popular -> The popular users /users -> A listing of all users /user/1 -> User 1 /user -> 301 redirect to /users. The only time someone would go to /user if they manually entered it in. In this case the user ends up being happy because they get to where they want to go. Having the singular/plural distinction makes URLs more readable too. /users/do_some_action /user/adam/do_some_action Its very clear whether its a member or collection action. On Aug 2, 8:59 am, Dan Kubb <dan.k...@autopilotmarketing.com> wrote:> > Am I horribly misguided in wanting to use plural and singular prefixes > > to distinguish between collections and individual entities?: > > > Collections: > > > /posts/tagged/ruby > > /posts/from/2007/12 > > /posts/written-by/tomafro > > /users > > > Individual items: > > > /user/tomafro > > /post/1 > > At one time I would''ve agreed with you on this, but I''ve come to admire > the way rails URL''s are "hackable" by default. That is, you can hack > off > the end of the URL, and more often than not you''re able to move to a > higher level of the hierarchy. I believe good websites and web apps > should have short, easy to read, hackable URLs. > > Here''s an article from Jakob Neilsen about how URLs are a strong part > of the user interface, and why it makes sense to pay attention to them: > URL as UI:http://www.useit.com/alertbox/990321.html > > I''ve heard all the standard REST arguments about URLs needing to be > opaque, > but I do believe that some users (myself included) rely on them to be > "hackable". In fact I tend to directly manipulate the URL more than > clicking on links in breadcrumbs or other navigation on web pages. > > -- > > Thanks, > > Dan > __________________________________________________________________ > > Dan Kubb > Autopilot Marketing Inc. > > Email: dan.k...@autopilotmarketing.com > Phone: 1 (604) 820-0212 > Web: http://autopilotmarketing.com/ > __________________________________________________________________--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Chris Kampmeier wrote:> On Jul 31, 4:44 pm, "Michael Koziarski" <mich...@koziarski.com> wrote: > >> Sounds a little too tricky for my liking. What we really want is a >> way for people to provide a prefix for their collection actions so >> that we can distinguish these two cases >> >> /users/the-prefix/popular >> /users/mr-popular >> > > I''ve used this before and it seems to make sense: > > /users/all/popular > /users/mr-popular > > cheers, > kampers >This seems to be really good solution. There is no need for edge cases or tricky tricks and all you need is reserve one username (the same way you''d reserve things like ''root'', ''admin'', etc.) /users/special/popular /users/special/badass /users/special/smartass /users/tom /users/koz /users/chris Using the name "special" reminds me of Wikipedia''s "Special:" namespace :-) And the URLs are hackable too (/users/special will list pages that are ''special'', just the same way the Wikipedia "Special" homepage says) -- Hendy Irawan www.hendyirawan.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
I raised this issue before in another forum when I discovered the switch from ; to / and got a response from David that it should be a non-issue. I didn''t really agree with that stance, but I do prefer the slash to semicolon overall for reasons similar to Ben. The solution is to either include the id in your to_param slugs. Or to define your methods as reserved words that can''t be used in the attribute that generates these slugs. Personally I lean towards the former as the cleaner solution. Either way I don''t see that it warrants a core change. Out of the box there is no conflict, only when you introduce your own slugs is extra care required. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---