Module: Tuttle::ApplicationHelper

Defined in:
app/helpers/tuttle/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#main_app_root_pathObject



16
17
18
# File 'app/helpers/tuttle/application_helper.rb', line 16

def main_app_root_path
  main_app.respond_to?(:root_path) ? main_app.root_path : '/'
end

#main_app_root_urlObject



20
21
22
# File 'app/helpers/tuttle/application_helper.rb', line 20

def main_app_root_url
  main_app.respond_to?(:root_url) ? main_app.root_url : '/'
end

#rails_guides_versioned_url(path) ⇒ Object



24
25
26
# File 'app/helpers/tuttle/application_helper.rb', line 24

def rails_guides_versioned_url(path)
  "http://guides.rubyonrails.org/v#{Tuttle::VersionDetector.rails_major_minor}/#{path}"
end

#truth_label(is_true, true_label = 'true', false_label = 'false') ⇒ Object



5
6
7
8
# File 'app/helpers/tuttle/application_helper.rb', line 5

def truth_label(is_true, true_label = 'true', false_label = 'false')
  (:span, is_true ? true_label : false_label,
              class: ['label', is_true ? 'label-success' : 'label-danger'])
end

#tuttle_redacted(enumarator) ⇒ Object



10
11
12
13
14
# File 'app/helpers/tuttle/application_helper.rb', line 10

def tuttle_redacted(enumarator)
  enumarator.collect do |key, value|
    yield key, redact_by_key(key, value)
  end
end