Module: Socializer::ApplicationHelper

Defined in:
app/helpers/socializer/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#current_user?(user) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'app/helpers/socializer/application_helper.rb', line 7

def current_user?(user)
  user == current_user
end

#signin_path(provider) ⇒ Object



3
4
5
# File 'app/helpers/socializer/application_helper.rb', line 3

def (provider)
  "/auth/#{provider.to_s}"
end

#time_ago(time, options = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'app/helpers/socializer/application_helper.rb', line 11

def time_ago(time, options = {})
  time = time.to_time.utc

  options.reverse_merge! title: l(time, format: :short)

  options[:data] ||= {}
  options[:data].merge! time_ago: 'moment.js'

  time_tag time, time.strftime('%B %e, %Y %l:%M%P'), options
end