# Rest nested resources - Help please

**URL:** <https://www.ruby-forum.com/t/rest-nested-resources-help-please/73608>\
**Category:** Rails\
**Created:** [October 25, 2006, 6:08pm UTC](https://www.ruby-forum.com/t/rest-nested-resources-help-please/73608 "2006-10-25T18:08:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![zanoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e99b99/32.png) [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Post date:** [October 25, 2006, 6:08pm UTC](https://www.ruby-forum.com/t/rest-nested-resources-help-please/73608/1 "2006-10-25T18:08:10Z")

</div>

I can’t believe I’m back again with another rest question. I did go  
through  
the peepcode podcast.  
I thought though you can have multiple nested resources, is that not  
true ?

I have this set up

map.resources :candidates do |candidate|  
candidate.resources :canbackgrounds  
candidate.resources :canpositions  
end

I just coded up teh canpositions and now all of a sudden I’m getting a  
no  
method error on canbackgrounds. Wondering if I’m wrong about multiple  
nests.

TIA  
Stuart

–

> **[Dark ambient](https://en.wikipedia.org/wiki/Dark_ambient)**
>
> Dark ambient (referred to as ambient industrial especially in the 1980s) is a genre of post-industrial music that features an ominous, dark droning and often gloomy, monumental or catacombal atmosphere, partially with discordant overtones. It shows similarities with ambient music, a genre that has been cited as a main influence by many dark ambient artists, both conceptually and compositionally. Although mostly electronically generated, dark ambient also includes the sampling of hand-pla 
> The te...

---

<div class="post-metadata">

**Author:** ![zanoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e99b99/32.png) [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Post date:** [October 25, 2006, 6:50pm UTC](https://www.ruby-forum.com/t/rest-nested-resources-help-please/73608/2 "2006-10-25T18:50:18Z")

</div>

On 10/25/06, Dark A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> candidate.resources :canpositions
> end
> 
> ```
> 
> I just coded up teh canpositions and now all of a sudden I’m getting a no  
> method error on canbackgrounds. Wondering if I’m wrong about multiple  
> nests.

After juggling around the code a bit and testing various things it looks  
like the above nested resources should be valid. However I’m getting  
this  
error:

Mysql::Error: #42S22Unknown column ‘canpositions.candidate\_id’ in ‘where  
clause’: SELECT count(\*) AS count\_all FROM canpositions WHERE (  
canpositions.candidate\_id = 12)

Which comes from my show code:

\<% unless @candidate.canpositions.empty? %\>  
\<%= render :partial =\> “/canpositions/canposition”, :collection =\> @  
candidate.canpositions %\>  
\<% end %\>

\<% if @candidate.canpositions.empty? %\>  
\<%= link\_to “Add background”, new\_canposition\_url(@candidate) %\>  
\<% end %\>

Not sure what’s going on.

Stuart

–

> [Dark ambient - Wikipedia](http://en.wikipedia.org/wiki/Dark_ambient)

–

> **[Dark ambient](https://en.wikipedia.org/wiki/Dark_ambient)**
>
> Dark ambient (referred to as ambient industrial especially in the 1980s) is a genre of post-industrial music that features an ominous, dark droning and often gloomy, monumental or catacombal atmosphere, partially with discordant overtones. It shows similarities with ambient music, a genre that has been cited as a main influence by many dark ambient artists, both conceptually and compositionally. Although mostly electronically generated, dark ambient also includes the sampling of hand-pla 
> The te...

---

<div class="post-metadata">

**Author:** ![zanoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e99b99/32.png) [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Post date:** [October 26, 2006, 2:05am UTC](https://www.ruby-forum.com/t/rest-nested-resources-help-please/73608/3 "2006-10-26T02:05:01Z")

</div>

In case nobody’s already mentioned this…

[http://www.eweek.com/article2/0%2C1895%2C2035260%2C00.asp](http://www.eweek.com/article2/0%2c1895%2c2035260%2c00.asp)

Checkitout!

---

<div class="post-metadata">

**Author:** ![zanoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e99b99/32.png) [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Post date:** [October 26, 2006, 6:13am UTC](https://www.ruby-forum.com/t/rest-nested-resources-help-please/73608/4 "2006-10-26T06:13:25Z")

</div>

John L. is one talented individual and a great voice of the ruby  
community especially to the .NET and microsoft world. This is a good  
thing for us.

---

<div class="post-metadata">

**Author:** ![zanoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e99b99/32.png) [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Post date:** [October 26, 2006, 5:53am UTC](https://www.ruby-forum.com/t/rest-nested-resources-help-please/73608/5 "2006-10-26T05:53:24Z")

</div>

On 10/25/06, s.ross [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> In case nobody’s already mentioned this…
> 
> [http://www.eweek.com/article2/0%2C1895%2C2035260%2C00.asp](http://www.eweek.com/article2/0%2c1895%2c2035260%2c00.asp)

It must be one of those VJ++ type of projects. What else can you  
expect from M$ ?

---

<div class="post-metadata">

**Author:** ![zanoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e99b99/32.png) [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Post date:** [October 26, 2006, 6:31am UTC](https://www.ruby-forum.com/t/rest-nested-resources-help-please/73608/6 "2006-10-26T06:31:28Z")

</div>

Agree… Imagine Ruby running much, much faster and closer to the  
iron. It would run on IIS and possibly also on mono. This is not  
about competing with Sun.

---

<div class="post-metadata">

**Author:** ![zanoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e99b99/32.png) [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Post date:** [October 26, 2006, 10:31am UTC](https://www.ruby-forum.com/t/rest-nested-resources-help-please/73608/7 "2006-10-26T10:31:43Z")

</div>

On Thu, 26 Oct 2006 02:10:44 -0200  
“Tim C.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> John L. is one talented individual and a great voice of the ruby  
> community especially to the .NET and microsoft world. This is a good  
> thing for us.

I agree. Ruby on win32 sucks horribly. Mongrel runs incredibly slow.  
Sockets throw weird errno exceptions. IO is painfully lacking.

If anyone can get a compatible Ruby 1.8 running on .NET it’d be a major  
advantage for a huge number of people.

Also, I don’t think MS is all that interested in the J++ strategy  
anymore. They only did that because they didn’t own the platform. With  
.NET, they own the platform, and they can sell it better when more  
languages run on it. Why else did they make it so easy to put other  
languages on their gear?

–  
Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu

> **[Zed A. shaw](https://zedshaw.com/)**
>
> Personal essays and writings by Zed A. Shaw.

[O'Reilly Media - Technology and Business Training](http://safari.oreilly.com/0321483502) – The Mongrel Book  
[http://mongrel.rubyforge.org/](http://mongrel.rubyforge.org/)  
[http://www.lingr.com/room/3yXhqKbfPy8](http://www.lingr.com/room/3yXhqKbfPy8) – Come get help.

---

<div class="post-metadata">

**Author:** ![zanoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e99b99/32.png) [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Post date:** [October 29, 2006, 3:28pm UTC](https://www.ruby-forum.com/t/rest-nested-resources-help-please/73608/8 "2006-10-29T15:28:53Z")

</div>

I’m an idiot ! I admit it. I had left the candidate\_id column out of  
the  
table! Doh!  
Forgive me

Stuart

On 10/25/06, Dark A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > map.resources :candidates do |candidate|  
> > like the above nested resources should be valid. However I’m getting this  
> > candidate.canpositions %\>
> 
> –  
> [Dark ambient - Wikipedia](http://en.wikipedia.org/wiki/Dark_ambient)

–

> **[Dark ambient](https://en.wikipedia.org/wiki/Dark_ambient)**
>
> Dark ambient (referred to as ambient industrial especially in the 1980s) is a genre of post-industrial music that features an ominous, dark droning and often gloomy, monumental or catacombal atmosphere, partially with discordant overtones. It shows similarities with ambient music, a genre that has been cited as a main influence by many dark ambient artists, both conceptually and compositionally. Although mostly electronically generated, dark ambient also includes the sampling of hand-pla 
> The te...
