2008/11/18 Liam Morley <[EMAIL PROTECTED]>:
>
> How about the following:
>
> resource :users, :member => {:edit-profile => :get}, :collection =>
> {:register => :get}

Can I do that? I didn't know it existed. Thanks

> and then rename those 'new' and 'edit' methods in your controller to
> fit the above scheme. I imagine (although I haven't tested) that if
> you then attempt to visit /users/new, the lack of a method in the
> controller would prompt a 404, which is the same result you'd get
> (hopefully) using your method.
>
> So it seems the functionality you're asking for probably already
> exists, using standard methods.
>
> Also, 'resource' is supposed to generate RESTful routes using RESTful
> convention. RESTful convention is (at least, everywhere I've seen) to
> use 'new' and 'edit'. If you don't want RESTful conventions,
> perhaps :url and .match might be a better fit, philosophically.
> Although, from first glance I think the above would fit your needs.
>
> Liam
>
>
> On Nov 17, 7:26 am, "Емил Иванов / Emil Ivanov"
> <[EMAIL PROTECTED]> wrote:
>> I don't that this will slow it down much. I'm all for flexibility.
>>
>> And, yes, the example with the block isn't the best one - simple hash will 
>> do:
>>
>> resource :users, :rotues => { :new => 'register', :edit => 'edit-profile' }
>>
>> A simple merge with the defaults will do the trick - no blocks or anything?
>>
>> Does it make more sense now?
>>
>> Also, if this could be a plugin - how can one be implemented (with the
>> hash notation)
>>
>> Regards
>>
>> 2008/11/17 Michael Klishin <[EMAIL PROTECTED]>:
>>
>>
>>
>> > 2008/11/17 Емил Иванов / Emil Ivanov <[EMAIL PROTECTED]>:
>> >> All this is very nice, but to to reflect business domain the above
>> >> routes would look better if they are
>>
>> >> /users/register
>> >> /users/edit-profile
>>
>> >> or something else.
>> >> It would be much better if the resource method allows something like
>> >> the following:
>>
>> >> resource :users do
>> >>  map :new => 'register'
>> >>  map :edit => 'edit-profile'
>> >> end
>>
>> > I feel strongly against of bloating merb-core with features like this.
>> > This is extra syntactic sugar that should be in the plugin.
>>
>> > --
>> > MK
>>
>> --
>> My place to share my ideas:http://vladev.blogspot.comhttp://carutoo.com
> >
>



-- 
My place to share my ideas:
http://vladev.blogspot.com
http://carutoo.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" 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/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to