Module: Upmin::ApplicationHelper

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

Instance Method Summary collapse

Instance Method Details

#body_classesObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/helpers/upmin/application_helper.rb', line 3

def body_classes
  ret = []

  controller = "c-#{params[:controller].gsub(/_/, "-").gsub("upmin/", "")}"
  ret << controller

  action = "a-#{params[:action].gsub(/_/, "-")}"
  ret << action

  if params[:klass]
    model = "m-#{params[:klass]}"
    ret << model
  end

  return ret
end

#body_dataObject



20
21
22
23
24
25
# File 'app/helpers/upmin/application_helper.rb', line 20

def body_data
  ret = {}
  ret[:controller] = params[:controller].camelize.gsub("Upmin::", "")
  ret[:action] = params[:action].camelize
  return ret
end