Account Options

  1. Sign in
Google Groups Home
« Groups Home
Fixing up resource route naming in 1.2.x
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Andrew White  
View profile  
 More options Aug 25 2007, 1:58 am
From: Andrew White <an...@pixeltrix.co.uk>
Date: Sat, 25 Aug 2007 06:58:03 +0100
Local: Sat, Aug 25 2007 1:58 am
Subject: Fixing up resource route naming in 1.2.x
(First time post here, so apologies in advance for any breaches of  
etiquette)

I'm writing a plugin for myself to change how resource routes are  
named to work round the issues with the semi-colon. I can't switch to  
edge as I'm using a e-commerce engine that I've written and the  
engines plugin doesn't support edge at the moment.

Leaving the issue of whether I should be using the engines plugin at  
the door, I'd like to be consistent with what might happen in 1.2.4.  
I've read <http://dev.rubyonrails.org/ticket/8558> and looked at the  
attached patch to stable and I was wondering what the likely outcome  
was as there has been no activity on the ticket for 7 weeks.

AFAICS the questions that need answering are:

1. Should the semi-colon be changed in 1.2.x?
2. Should nested resources routes be named as in edge with the old  
names being deprecated?
3. Should new resource route functionality such as namespaces,  
associations, requirements and conditions be included?
4. Should ActionController::RecordIdentifier be included?
5. Should ActionController::PolymorphicRoutes be included?
6. Should MethodNotAllowed and NotImplemented be included?

I'd be more than willing to write up an acceptable patch to stable if  
required.

Andrew White


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Koziarski  
View profile  
 More options Aug 28 2007, 1:02 am
From: "Michael Koziarski" <mich...@koziarski.com>
Date: Tue, 28 Aug 2007 17:02:14 +1200
Local: Tues, Aug 28 2007 1:02 am
Subject: Re: [Rails-core] Fixing up resource route naming in 1.2.x

> 1. Should the semi-colon be changed in 1.2.x?

No,  though we should probably just make that a class variable so you
can override if needs be. (for both trunk and stable)

> 2. Should nested resources routes be named as in edge with the old
> names being deprecated?

Yes

> 3. Should new resource route functionality such as namespaces,
> associations, requirements and conditions be included?

No

> 4. Should ActionController::RecordIdentifier be included?

No

> 5. Should ActionController::PolymorphicRoutes be included?

No

> 6. Should MethodNotAllowed and NotImplemented be included?

No

> I'd be more than willing to write up an acceptable patch to stable if
> required.

In my view, all that's needed is to warn about the old generated named
routes, and support changing from ; to / for :member and friends.
Everything else should probably be written up in a wiki page for
inclusion in the release notes.

--
Cheers

Koz


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew White  
View profile  
 More options Aug 28 2007, 1:34 am
From: Andrew White <an...@pixeltrix.co.uk>
Date: Tue, 28 Aug 2007 06:34:48 +0100
Local: Tues, Aug 28 2007 1:34 am
Subject: Re: [Rails-core] Re: Fixing up resource route naming in 1.2.x

On 28 Aug 2007, at 06:02, Michael Koziarski wrote:

> In my view, all that's needed is to warn about the old generated named
> routes, and support changing from ; to / for :member and friends.
> Everything else should probably be written up in a wiki page for
> inclusion in the release notes.

Okay I'll come up with a patch for stable and edge that uses a class  
variable for the resource action and deprecates the old route names  
for stable. Should I put them both under one ticket or separate tickets?

One other question - should the new formatted named routes place the  
format parameter at the end of the url like they are in edge? The old  
named routes could maintain the existing placement for backwards  
compatibility.

Andrew White

Pixeltrix                        T: 024 7625 6244
12 Turbine Hall                  M: 07973 190 907
Electric Wharf                   F: 024 7625 6266
Coventry CV1 4JB                 www.pixeltrix.co.uk


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew White  
View profile  
 More options Aug 28 2007, 2:17 am
From: Andrew White <an...@pixeltrix.co.uk>
Date: Tue, 28 Aug 2007 07:17:30 +0100
Local: Tues, Aug 28 2007 2:17 am
Subject: Re: [Rails-core] Re: Fixing up resource route naming in 1.2.x

On 28 Aug 2007, at 06:02, Michael Koziarski wrote:

>> 2. Should nested resources routes be named as in edge with the old
>> names being deprecated?

> Yes

One other thing - should the deprecated old names remain in edge/2.0  
or should they be removed?

Andrew White

Pixeltrix                        T: 024 7625 6244
12 Turbine Hall                  M: 07973 190 907
Electric Wharf                   F: 024 7625 6266
Coventry CV1 4JB                 www.pixeltrix.co.uk


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew White  
View profile  
 More options Aug 28 2007, 5:57 am
From: Andrew White <an...@pixeltrix.co.uk>
Date: Tue, 28 Aug 2007 10:57:56 +0100
Local: Tues, Aug 28 2007 5:57 am
Subject: Re: [Rails-core] Re: Fixing up resource route naming in 1.2.x
On 28 Aug 2007, at 06:02, Michael Koziarski wrote:

> In my view, all that's needed is to warn about the old generated named
> routes, and support changing from ; to / for :member and friends.
> Everything else should probably be written up in a wiki page for
> inclusion in the release notes.

Just looking at the names of the routes generated in edge at the  
moment I notice that the namespace is passed using the name_prefix  
option. This means that the follow route definition:

   map.namespace :admin do |admin|
     admin.resources :images, :member => {:thumbnail => :get}
   end

gives the following names:

             thumbnail_admin_image = /admin/images/:id/thumbnail/
   formatted_thumbnail_admin_image = /admin/images/:id/
thumbnail.:format/

Is this correct? Shouldn't the namespace go before the action and  
after the formatted keyword? e.g.

             admin_thumbnail_image = /admin/images/:id/thumbnail/
   formatted_admin_thumbnail_image = /admin/images/:id/
thumbnail.:format/

Obviously if stable is not having namespaces then this isn't an issue  
there unless people emulate namespaces by using name_prefix and  
path_prefix and then upgrade to 2.0 and rewrite their routes using  
namespaces.

Andrew White


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew White  
View profile  
 More options Aug 28 2007, 11:52 am
From: Andrew White <an...@pixeltrix.co.uk>
Date: Tue, 28 Aug 2007 16:52:07 +0100
Local: Tues, Aug 28 2007 11:52 am
Subject: Re: [Rails-core] Re: Fixing up resource route naming in 1.2.x
On 28 Aug 2007, at 06:02, Michael Koziarski wrote:

> In my view, all that's needed is to warn about the old generated named
> routes, and support changing from ; to / for :member and friends.
> Everything else should probably be written up in a wiki page for
> inclusion in the release notes.

I have a patch for stable which does the following:

1. Adds a class variable to ActionController::Base called
    resource_action_separator defaulting to ';'

2. If a named route has changed it generates methods with the old names
    which redirect to the new name with a deprecation warning

3. Moves the format parameter to the end of the path for all urls.
    This has the added benefit of fixing caching for these actions

It passes the current tests but I still need to add some to check for
the deprecated routes names being added. Are there any existing tests
for deprecated functionality that I can look at to get an idea of how
to do them?

When I've done that should I create a new ticket or upload the patch
to the existing ticket 8558?

Andrew White


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tobias Luetke  
View profile  
 More options Aug 28 2007, 5:56 pm
From: Tobias Luetke <tobias.lue...@gmail.com>
Date: Tue, 28 Aug 2007 14:56:49 -0700
Local: Tues, Aug 28 2007 5:56 pm
Subject: Re: Fixing up resource route naming in 1.2.x
Andrew,

Sounds great, please do attach the patch to http://dev.rubyonrails.org/ticket/8558
and i'll get it in if you think its ready.
Thanks a lot for looking into this.

On Aug 28, 11:52 am, Andrew White <an...@pixeltrix.co.uk> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew White  
View profile  
 More options Aug 28 2007, 10:37 pm
From: Andrew White <an...@pixeltrix.co.uk>
Date: Wed, 29 Aug 2007 03:37:00 +0100
Subject: Re: [Rails-core] Re: Fixing up resource route naming in 1.2.x

On 28 Aug 2007, at 22:56, Tobias Luetke wrote:

> Sounds great, please do attach the patch to http://
> dev.rubyonrails.org/ticket/8558
> and i'll get it in if you think its ready.
> Thanks a lot for looking into this.

Patches for stable and edge with tests have been uploaded.

Andrew White

Pixeltrix                        T: 024 7625 6244
12 Turbine Hall                  M: 07973 190 907
Electric Wharf                   F: 024 7625 6266
Coventry CV1 4JB                 www.pixeltrix.co.uk


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »