Module: Cream::Helper::AuthLabel

Defined in:
lib/cream/helper/authlabels.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



17
18
19
# File 'lib/cream/helper/authlabels.rb', line 17

def self.included(base)
  base.helper_method :auth_labels
end

Instance Method Details

#auth_labelsObject



3
4
5
# File 'lib/cream/helper/authlabels.rb', line 3

def auth_labels
  @auth_labels ||= translate_labels
end

#translate_labelsObject



7
8
9
10
11
12
13
14
15
# File 'lib/cream/helper/authlabels.rb', line 7

def translate_labels
  ns_actions = 'cream.actions'
  labels = {}
  %w{new edit delete show sign_in sign_out sign_up edit_registration}.each do |action|     
    labels[action.to_sym] = t "#{ns_actions}.#{action}"
  end 
  labels[:confirm] = t 'cream.confirm'
  labels           
end