Rest nested resources - Help please

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

On 10/25/06, Dark A. [email protected] 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

In case nobody’s already mentioned this…

http://www.eweek.com/article2/0%2C1895%2C2035260%2C00.asp

Checkitout!

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.

On 10/25/06, s.ross [email protected] wrote:

In case nobody’s already mentioned this…

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$ ?

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.

On Thu, 26 Oct 2006 02:10:44 -0200
“Tim C.” [email protected] 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

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

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. [email protected] wrote:

map.resources :candidates do |candidate|
like the above nested resources should be valid. However I’m getting this
candidate.canpositions %>


Dark ambient - Wikipedia