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
:candidates do |candidate|
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.