Class: Thredded::TopicView

Inherits:
BaseTopicView
  • Object
show all
Defined in:
app/view_models/thredded/topic_view.rb

Instance Method Summary collapse

Instance Method Details

#pathObject



5
6
7
8
9
10
11
12
13
# File 'app/view_models/thredded/topic_view.rb', line 5

def path
  anchor = if @read_state.first_unread_post_page
             "unread"
           elsif @topic.last_post
             "post_#{@topic.last_post.id}"
           end
  page = @read_state.first_unread_post_page || @read_state.last_read_post_page
  Thredded::UrlsHelper.topic_path(@topic, page: page, anchor: anchor)
end