Displaying 1 result from an estimated 1 matches for "recent_post".
2011 Mar 02
0
polymorphic_path not getting generated
...class Topic < ActiveRecord::Base
belongs_to :forum
end
class School < ActiveRecord::Base
has_many :forums, :as => :forum_owner
end
Now in the index.html.erb for forum I had the following line
<%= link_to t(:view), forum_topic_path(:forum_id => forum, :id
=> forum.recent_post.topic_id, :page =>
forum.recent_post.topic.last_page, :anchor =>
forum.recent_post.dom_id) %>
This line generates "http://127.0.0.1:3001/forums/1/topics/1?
page=1#posts-1" as the url. To make it polymorphic, I need the schools
in the url so the url needs to change to "http:...