Module: Jabe::PublicEntryUrl

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



6
7
8
# File 'lib/jabe.rb', line 6

def self.included( base )
  base.send(:helper_method, :public_entry_url) if base.respond_to?(:helper_method)
end

Instance Method Details

#public_entry_url(entry) ⇒ Object



10
11
12
# File 'lib/jabe.rb', line 10

def public_entry_url(entry)
  "http://#{SETTINGS.host_name}#{root_path}#{entry.published_at.in_time_zone.to_s(:url_part)}/#{entry.to_param}"
end