Namespaces, routing and Picto/Conversatio/Conclave

1 view
Skip to first unread message

Dan B

unread,
Mar 5, 2010, 10:24:56 AM3/5/10
to tog_users
Is there a simple way to change the routing so that Conclave, for
example, shows up as Meetings or Events? I appreciate the separation
of namespaces but my audience doesn't always appreciate the latin.

Alberto Molpeceres

unread,
Mar 5, 2010, 11:14:36 AM3/5/10
to tog_...@googlegroups.com
Yep, you can update your routes from something like:

namespace(:conclave) do |conclave|
conclave.resources :events, :member => {:map => :get, :attendees => :get}
end

to

namespace(:conclave, :path_prefix => 'meetings') do |conclave|
conclave.resources :events, :member => {:map => :get, :attendees => :get}
end

Note the :path_prefix option. This option is available also for
mapping resources, etc.

al.

--
Alberto Molpeceres.
Linking Paths.

Simple registration for your events. http://www.stagehq.com

> --
> You received this message because you are subscribed to the Google Groups "tog_users" group.
> To post to this group, send email to tog_...@googlegroups.com.
> To unsubscribe from this group, send email to tog_users+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/tog_users?hl=en.
>
>

Dan Blue

unread,
Mar 5, 2010, 11:20:28 AM3/5/10
to tog_...@googlegroups.com
Thanks Al. That seems straightforward enough. That would replace map.routes_from_plugin 'tog_conclave' in my app's config/routes.rb file, right? Or would I need to change config/desert_routes.rb in the plugin?


I know that I could code that desert_routes.rb

Alberto Molpeceres

unread,
Mar 5, 2010, 11:41:18 AM3/5/10
to tog_...@googlegroups.com
I would recommend you NOT to change a file from the plugin, so it will
be easier for you to update the code. So removing the
"map.routes_from_plugin 'tog_conclave'" from your routes.rb and adding
those routes from desert_routes.rb to it should be ok (you will ned to
add "map." to each block).

But in fact, I have nothing against changing the default routes of the
plugin to match something like what you are trying to achieve.

al.


--
Alberto Molpeceres.
Linking Paths.

Simple registration for your events. http://www.stagehq.com

Dan Blue

unread,
Mar 5, 2010, 11:47:24 AM3/5/10
to tog_...@googlegroups.com
I agree that I shouldn't touch the plugin (even the default routes)... it's easier to update if it hasn't been altered. I just know that if I ask the question now, it is forever recorded online with Google Groups and when I forget the answer in a few months, I'll be able to retrieve it!

It also makes it easier to submit patches to the various plugins.

Thanks again for the responses.

Reply all
Reply to author
Forward
0 new messages