Module: HelpTipsHelper

Defined in:
app/helpers/help_tips_helper.rb

Instance Method Summary collapse

Instance Method Details

#help_button(html_options = {}) ⇒ Object



24
25
26
27
# File 'app/helpers/help_tips_helper.rb', line 24

def help_button(html_options = {})
  html_options.reverse_merge! :class => 'btn', 'data-toggle' => 'modal'
  link_to('<i class="icon-question-sign"></i> Help'.html_safe, "#help-modal", html_options)
end

#help_modal_cancel_buttonObject



29
30
31
# File 'app/helpers/help_tips_helper.rb', line 29

def help_modal_cancel_button
  link_to('Cancel', '#', :class => 'btn', 'data-dismiss' => 'modal')
end

#help_modal_content(title = nil, body = nil, footer = nil, &block) ⇒ Object



16
17
18
19
20
21
22
# File 'app/helpers/help_tips_helper.rb', line 16

def help_modal_content(title = nil, body = nil, footer = nil, &block)
  if block_given?
    footer = body
    body = capture(&block)
  end
  content_for(:help_modal) { render('help_tips/help_modal', :title => title, :body => body, :footer => footer) }
end

#help_tip(title = nil, body = nil, identifier = "#{params[:controller]}_#{params[:action]}", &block) ⇒ Object



7
8
9
10
11
12
13
14
# File 'app/helpers/help_tips_helper.rb', line 7

def help_tip(title = nil, body = nil, identifier = "#{params[:controller]}_#{params[:action]}", &block)
  if block_given?
    identifier = body
    body = capture(&block)
  end

  render('help_tips/help_tip', :title => title, :body => body, :identifier => identifier) unless TipHide.hidden?(current_user, identifier)
end

#help_tip_content(*args, &block) ⇒ Object



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

def help_tip_content(*args, &block)
  content_for :help_tip, help_tip(*args, &block)
end