The file is hobo/lib/hobo/model_router.rb

My old:

127   def plural
128     model.name.underscore.pluralize
129   end
130
131
132   def singular
133     model.name.underscore
134   end

My new:

127   def plural
128     # route by controller name not model name -dwm
129     #model.name.underscore.pluralize
130     controller.controller_name
131   end
132
133
134   def singular
135     # route by controller name not model name -dwm
136     #model.name.underscore
137     controller.controller_name.singularize
138   end

-david

On Mon, Aug 24, 2009 at 7:52 AM, Brett Nelson<[email protected]> wrote:
>
> This is something I would very much like to do.  Where did you define
> these?
>
> Brett
>
>
> On Aug 24, 7:39 am, David Mathers <[email protected]> wrote:
>> Hello,
>>
>> Based on the fact that hobo_model_controller takes a model name as an
>> argument, I assumed that if I created a Foo resource and then replaced
>> my FoosController with:
>>
>> class BarsController < ApplicationController
>>   hobo_model_controller Foo
>>   auto_actions :all
>> end
>>
>> That I would then have bar routes instead of foo routes. But it turns
>> out the routes are named after models. It seems very strange to me to
>> not name routes after controllers. Is there a reason for this?
>>
>> I went ahead and redefined ModelRouter#plural to
>> "controller.controller_name" and ModelRouter#singular to
>> "controller.controller_name.singularize". Everything seems OK so far,
>> but I wanted to check and make sure it won't cause problems.
>>
>> -david
> >
>

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

Reply via email to