Method: ApplicationHelper#generic_share_link
- Defined in:
- app/helpers/application_helper.rb
#generic_share_link(post) ⇒ String
Gets a shareable URL to the specified post, taking into account post type.
150 151 152 153 154 155 156 |
# File 'app/helpers/application_helper.rb', line 150 def generic_share_link(post) if second_level_post_types.include?(post.post_type_id) answer_post_url(id: post.parent_id, answer: post.id, anchor: "answer-#{post.id}") else post_url(post) end end |