# Add a member to a pre-existing resource-route?

**URL:** <https://www.ruby-forum.com/t/add-a-member-to-a-pre-existing-resource-route/191853>\
**Category:** Rails\
**Created:** [July 19, 2010, 9:07pm UTC](https://www.ruby-forum.com/t/add-a-member-to-a-pre-existing-resource-route/191853 "2010-07-19T21:07:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrochkind](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/779978/32.png) [@jrochkind](https://www.ruby-forum.com/u/jrochkind)\
**Post date:** [July 19, 2010, 9:07pm UTC](https://www.ruby-forum.com/t/add-a-member-to-a-pre-existing-resource-route/191853/1 "2010-07-19T21:07:34Z")

</div>

Rails2. If a route has already been established with “map.resources”,  
is there any way I can add an additional member to it, without  
over-writing what’s already there?

This comes up in two engines-style plugins interacting with each other  
and with the app itself.

---

<div class="post-metadata">

**Author:** ![jrochkind](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/779978/32.png) [@jrochkind](https://www.ruby-forum.com/u/jrochkind)\
**Post date:** [July 19, 2010, 10:00pm UTC](https://www.ruby-forum.com/t/add-a-member-to-a-pre-existing-resource-route/191853/2 "2010-07-19T22:00:46Z")

</div>

Jonathan R. wrote:

> Rails2. If a route has already been established with “map.resources”,  
> is there any way I can add an additional member to it, without  
> over-writing what’s already there?
> 
> This comes up in two engines-style plugins interacting with each other  
> and with the app itself.

Just define the route as you normally would (with map.connect ).  
map.resources is not magical; it’s just shorthand for a bunch of  
map.connect statements.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![jrochkind](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/779978/32.png) [@jrochkind](https://www.ruby-forum.com/u/jrochkind)\
**Post date:** [July 19, 2010, 10:25pm UTC](https://www.ruby-forum.com/t/add-a-member-to-a-pre-existing-resource-route/191853/3 "2010-07-19T22:25:36Z")

</div>

Marnen Laibow-Koser wrote:

> Jonathan R. wrote:
> 
> > Rails2. If a route has already been established with “map.resources”,  
> > is there any way I can add an additional member to it, without  
> > over-writing what’s already there?
> 
> Just define the route as you normally would (with map.connect ).  
> map.resources is not magical; it’s just shorthand for a bunch of  
> map.connect statements.

Ah, i was worried that my second map.resources would ‘over-ride’ certain  
things from the first one. But it looks like it doesn’t. If you call  
map.resources once with certain :members, and then call it again with  
another :member… it LOOKS like indeed all the aggregated members are  
now there. Cool. Thanks.

---

<div class="post-metadata">

**Author:** ![jrochkind](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/779978/32.png) [@jrochkind](https://www.ruby-forum.com/u/jrochkind)\
**Post date:** [July 19, 2010, 11:44pm UTC](https://www.ruby-forum.com/t/add-a-member-to-a-pre-existing-resource-route/191853/4 "2010-07-19T23:44:39Z")

</div>

Jonathan R. wrote:

> Marnen Laibow-Koser wrote:
> 
> > Jonathan R. wrote:
> > 
> > > Rails2. If a route has already been established with “map.resources”,  
> > > is there any way I can add an additional member to it, without  
> > > over-writing what’s already there?
> > 
> > Just define the route as you normally would (with map.connect ).  
> > map.resources is not magical; it’s just shorthand for a bunch of  
> > map.connect statements.
> 
> Ah, i was worried that my second map.resources would ‘over-ride’ certain  
> things from the first one. But it looks like it doesn’t. If you call  
> map.resources once with certain :members, and then call it again with  
> another :member… it LOOKS like indeed all the aggregated members are  
> now there. Cool. Thanks.

Interesting to know. I’d tend to only call map.resources once and then  
use map.connect, but it’s good to know that it works either way.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
