Module: Write::ApplicationHelper

Included in:
PostsController
Defined in:
app/helpers/write/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#login_userObject



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

def 
  defined?(current_user) && current_user
end

#timestamp_display(post) ⇒ Object



11
12
13
14
15
16
17
# File 'app/helpers/write/application_helper.rb', line 11

def timestamp_display post
  words = time_ago_in_words(post.created_at) + " ago"
  if post.updated?
    words << " (Updated #{time_ago_in_words(post.updated_at)} ago)"
  end
  words
end

#write_admin?Boolean

Returns:

  • (Boolean)


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

def write_admin?
   && Write.admin?(.github)
end