Good morning All -
I am working on a time tracking application as a learning excercise
and have run into an error neither I nor Google can remedy.
When loading my view, I get an error: 'undefined method
'true_class_path' for #<ActionView::Base:.........
Context:
I have controllers for Project, Worktrack and 'Workbench', among
others. Workbench is where users would actually assign Worktracks to
projects. There is no 'Workbench' table - I created just a controller
for it, based on the 'Cart' controller in Agile Web Development.
Project and Worktrack have complete scaffolds.
Workbench View code:
<%= button_to "Add Worktrack", assign_worktrack(project) %>
Workbench Controller code:
def assign_worktrack(project_identifier)
project_identifier.worktracks << Worktrack.new(:status => "Not
Started")
project_identifier.save
end
I am struggling with the following:
1. Google-ing true_class_path in almost any context provides no useful
information - I'm not sure what the error even means, aside from the
name, and I can't figure out an action based on having an apparently
bad path. Diagnosis hints would be much appreciated.
2. In the 'proper MVC / Rails' realm - should my method be in the
controller, or somewhere else? I tried moving it to the
projects_helper and application_helper files assuming that this would
help Rails connect the dots to the appropriate path, but that did not
work and 'felt wrong'.
3. My code is probably suboptimal - like I said, I'm just learning RoR
and Ruby. Suggestions in that realm, especially if I have anything WTF-
worthy are welcome.
To me, this whole issue smells like "I put my code in the wrong place
and confused Rails", but I can't get any further.
Any help or insight would be much appreciated.
Thanks in advance for your time -
SR