Module: Write::ApplicationHelper
- Included in:
- PostsController
- Defined in:
- app/helpers/write/application_helper.rb
Instance Method Summary collapse
- #head_links ⇒ Object
- #login_user ⇒ Object
- #post_snippet(post) ⇒ Object
- #timestamp_display(post) ⇒ Object
- #write_admin? ⇒ Boolean
Instance Method Details
#head_links ⇒ Object
19 20 21 22 |
# File 'app/helpers/write/application_helper.rb', line 19 def head_links content_for :head, auto_discovery_link_tag(: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 14 15 16 17 |
# File 'app/helpers/write/application_helper.rb', line 11 def 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 |