I have 2 models with a standard 1 to many relationship. I’m also using
REST on the two models and have added the appropriate code to the
class Scorecard < ActiveRecord::Base
class Attribute < ActiveRecord::Base
map.resources :scorecards do |scorecard|
My problem is that I want to show a single scorecard with all it’s
attributes. I then want to display a “New attribute” link to add a new
attribute to the current scorecard.
<%= label_for(“scorecard”) %>
<%=h @scorecard.name %>
<%= label_for(“template”) %>
<%=h @scorecard.template %>
|<%=h attribute.name %>||<%=h attribute.weight %>|
However I get the message for line 17 (last line) when I try to view
You have a nil object when you didn’t expect it!
The error occurred while evaluating nil.to_sym
I have tried checking against various REST and Rails books and articles,
and I thought I had used the correct syntax for creating a link to a new
attribute from this scorecard.
Any help on this would be greatly appreciated.