Module: StreamHelper

Defined in:
app/helpers/stream_helper.rb

Overview

Copyright © 2010-2011, Diaspora Inc. This file is

licensed under the Affero General Public License version 3 or later.  See
the COPYRIGHT file.

Instance Method Summary collapse

Instance Method Details

#next_page_path(opts = {}) ⇒ Object


8
9
10
11
12
13
14
15
16
17
18
# File 'app/helpers/stream_helper.rb', line 8

def next_page_path(opts ={})
  if controller.instance_of?(TagsController)
    tag_path(:name => @stream.tag_name, :max_time => time_for_scroll(@stream))
  elsif controller.instance_of?(PeopleController)
    local_or_remote_person_path(@person, :max_time => time_for_scroll(@stream))
  elsif controller.instance_of?(StreamsController)
    next_stream_path
  else
    raise 'in order to use pagination for this new controller, update next_page_path in stream helper'
  end
end

#reshare?(post) ⇒ Boolean

Returns:

  • (Boolean)

20
21
22
# File 'app/helpers/stream_helper.rb', line 20

def reshare?(post)
  post.instance_of?(Reshare)
end