Module: Write::ApplicationHelper

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

Instance Method Summary collapse

Instance Method Details

#atom_feed_urlObject



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

def atom_feed_url
  Write.feed_url || feed_url
end


15
16
17
18
# File 'app/helpers/write/application_helper.rb', line 15

def head_links
  content_for :head, auto_discovery_link_tag(:atom, atom_feed_url, :title => Write.full_title) +
    stylesheet_link_tag("write/application", :media => "all")
end

#login_userObject



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

def 
  defined?(current_user) && current_user
end

#post_snippet(post) ⇒ Object



24
25
26
# File 'app/helpers/write/application_helper.rb', line 24

def post_snippet post
  truncate_html(Write::MD.render(post.content), :length => 256).html_safe
end

#timestamp_display(post) ⇒ Object



11
12
13
# File 'app/helpers/write/application_helper.rb', line 11

def timestamp_display post
  time_ago_in_words(post.created_at) + " ago"
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