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

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.

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


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

Stuart

In case nobody's already mentioned this...

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

Checkitout!

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

John Lam 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.

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.

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?