Module: Write::ApplicationHelper
- Included in:
- PostsController
- Defined in:
- app/helpers/write/application_helper.rb
Instance Method Summary collapse
- #atom_feed_url ⇒ Object
- #head_links ⇒ Object
- #login_user ⇒ Object
- #post_snippet(post) ⇒ Object
- #timestamp_display(post) ⇒ Object
- #write_admin? ⇒ Boolean
Instance Method Details
#atom_feed_url ⇒ Object
20 21 22 |
# File 'app/helpers/write/application_helper.rb', line 20 def atom_feed_url Write.feed_url || feed_url end |
#head_links ⇒ Object
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_user ⇒ Object
7 8 9 |
# File 'app/helpers/write/application_helper.rb', line 7 def login_user 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 post time_ago_in_words(post.created_at) + " ago" end |