On Thu, Jan 8, 2009 at 1:35 PM, AkitaOnRails <[email protected]> wrote:
>
> As we are already using :member => { :new => :get }, what about
> actually having a  'clone' action and change it to :member => { :clone
> => :get } ?

Yup:

commit 342f7b727c5aadb796fff6ac5f7dedf4647e1a1c
Author: Johan Sørensen <[email protected]>
Date:   Mon Jan 12 11:05:28 2009 +0100

    rename RepositoryController#new/create to #clone/#create_clone to
avoid future
    confusion and rails issues. Update AUTHORS as well.


JS


>
> On Jan 8, 6:38 am, "Johan Sørensen" <[email protected]> wrote:
>> Hi,
>>
>> On Wed, Jan 7, 2009 at 7:47 PM, AkitaOnRails <[email protected]> wrote:
>> > If you're watching the newest updates to the main repo, you'll see
>> > that I've been quite busy :-)
>>
>> Very nice, thanks for the work.
>>
>>
>>
>> > But there are still some oddities that I would like to expose
>> > here. One is actually breaking my head right now.
>>
>> > Take this route:
>>
>> > map.resources :projects do |projects|
>> >  projects.resources :repositories, :member => { :new => :get }
>> > end
>>
>> > This is a simplification of the clone page. If I load this under Rails
>> > 2.1.0 and simulate his named route:
>>
>> >>> new_project_repository_path(1,2)
>>
>> > It works properly and gives back:
>>
>> > => "/projects/1/repositories/2/new"
>>
>> > But, if I just change the version to Rails 2.2.2 and run it again, now
>> > I have:
>>
>> >>> new_project_repository_path(1,2)
>> > NoMethodError: You have a nil object when you didn't expect it!
>> > The error occurred while evaluating nil.to_sym>
>> > [snip]
>> > Does anyone know what have changed in the nesting logic of 2.2.2 that
>> > makes this break to badly?
>>
>> I think the primary reason is probably that we're breaking rails
>> conventions horribly here, basically the #new and #create actions in
>> the RepositoriesController behave very differently in that they
>> require the repository id as well in the route
>> (/projects/x/repos/y/new as opposed to the usual rails way:
>> /projects/x/repos/new). I've forgotting my originally reasoning for
>> breaking that convention, but probably related to being too lazy to
>> figure out two better action names, or move it to another controller.
>> Any suggestions for a nicer approach? The intent of the to actions is
>> to clone a repository.
>>
>> JS
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Gitorious" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/gitorious?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to