Created
November 6, 2015 10:56
-
-
Save MichaelCPell/08fb6af5c27b0466366f to your computer and use it in GitHub Desktop.
Differnet link to depending on class type.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% @pg_searches.each do |pg_search| %> | |
<% if pg_search.searchable.class == Book %> | |
<p> <%= link_to pg_search.searchable.title, pg_search.searchable %></p> | |
<% elsif pg_search.searchable.class == Chapter %> | |
<p> <%= link_to pg_search.searchable.title, [pg_search.searchable.book, pg_search.searchable] %></p> | |
<% end %> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment