Module: HackathonManagerHelper

Defined in:
app/helpers/hackathon_manager_helper.rb

Instance Method Summary collapse

Instance Method Details

#asset_available?(logical_path) ⇒ Boolean

Returns:

  • (Boolean)


29
30
31
32
33
34
35
# File 'app/helpers/hackathon_manager_helper.rb', line 29

def asset_available?(logical_path)
  if Rails.configuration.assets.compile
    Rails.application.precompiled_assets.include? logical_path
  else
    Rails.application.assets_manifest.assets[logical_path].present?
  end
end


7
8
9
10
# File 'app/helpers/hackathon_manager_helper.rb', line 7

def btn_link_to(name, path, options = {})
  options[:class] ? options[:class] += " button" : options[:class] = "button"
  link_to(name, path, options)
end

#markdown(text) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
# File 'app/helpers/hackathon_manager_helper.rb', line 16

def markdown(text)
  markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML,
                                     no_intra_emphasis: true,
                                     fenced_code_blocks: true,
                                     disable_indented_code_blocks: true,
                                     autolink: true,
                                     tables: true,
                                     underline: true,
                                     hard_wrap: true)
  markdown.render(text).html_safe
end


12
13
14
# File 'app/helpers/hackathon_manager_helper.rb', line 12

def phone_link_to(phone_number)
  link_to(phone_number, "tel:#{phone_number}")
end

#title(page_title) ⇒ Object



2
3
4
5
# File 'app/helpers/hackathon_manager_helper.rb', line 2

def title(page_title)
  content_for(:title) { page_title + " - #{Rails.configuration.hackathon['name']}" }
  page_title
end