Hello, i have table AuditLog with fields including: audited_id |
audited_type
That results in data like:
108 | Photo
303 | Comment
What I want to do is create a link to the item, so for the example
above:
<a href="/photos/108">here is the photo</a>
I'm trying to use a polymorphic_path but am getting an error:
"undefined method `model_name' for Fixnum:Class"
When using:
<%= link_to 'Here she is', polymorphic_path([audited_id,
audited_type]) %>
Ideas? Thanks
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment