I'm not sure if this is a DataMapper issue or a Merb issue. I have
two models - Project and Company. Project has a belongs_to :company
association. Company has a "has n :projects" association.
On the show view for a project, I want the associated company along
with a link to that company's show action.
Calling resource() with the associated object directly results in a
Generation Error. However, if I load the company recored fresh from
the database, it works.
Doesn't Work:
<%= link_to @
project.company.name, resource(@project.company) %>
Works:
<%= link_to @
project.company.name, resource(Company.get
(@
project.company.id)) %>
Do I need to do something different with my associations? Is this a
bug or am I just missing something?
Thanks,
Glen