Sha256: 5350f195ff89ae9e6a373f7ed728f01ee28cd58ffb25680d73c96a621796602f

Contents?: true

Size: 415 Bytes

Versions: 2

Compression:

Stored size: 415 Bytes

Contents

module Theblog
  module ApplicationHelper
    def link_to_content_node(node)
      link = if node.parent_node.present?
                theblog.content_node_path(node.parent_node.slug, node.slug)
             else
                theblog.root_content_node_path(node.slug)
             end

      if block_given?
        link_to(link) { yield }
      else
        link_to node.title, link
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
theblog-0.0.1.1 app/helpers/theblog/application_helper.rb
theblog-0.0.1 app/helpers/theblog/application_helper.rb