app/controllers/calagator/application_controller.rb in koalagator-2.0.0 vs app/controllers/calagator/application_controller.rb in koalagator-2.1.0
- old
+ new
@@ -39,36 +39,37 @@
password: Calagator.admin_password,
if: proc { Calagator.admin_username && Calagator.admin_password }
)
)
end
+ private_class_method :require_admin
#---[ Helpers ]---------------------------------------------------------
# Returns a data structure used for telling the CSS menu which part of the
# site the user is on. The structure's keys are the symbol names of resources
# and their values are either "active" or nil.
def link_class
@_link_class_cache ||= {
- events: ((controller_name == 'events' ||
- controller_name == 'sources' ||
- controller_name == 'site') && 'active'),
- venues: (controller_name == 'venues' && 'active')
+ events: ((controller_name == "events" ||
+ controller_name == "sources" ||
+ controller_name == "site") && "active"),
+ venues: (controller_name == "venues" && "active")
}
end
helper_method :link_class
#---[ Misc ]------------------------------------------------------------
# Set or append flash +message+ (e.g. "OMG!") to flash key with the name
# +kind+ (e.g. :failure).
def append_flash(kind, message)
kind = kind.to_sym
- flash[kind] = if leaf = flash[kind]
- "#{leaf} #{message}"
- else
- message.to_s
- end
+ flash[kind] = if (leaf = flash[kind])
+ "#{leaf} #{message}"
+ else
+ message.to_s
+ end
end
# Make it possible to use helpers in controllers
# http://www.johnyerhot.com/2008/01/10/rails-using-helpers-in-you-controller/
class Helper