Sha256: a73e148eb06f2ae744b732681240ee84b47f7975d935f968ea9345e9da6dc6fe
Contents?: true
Size: 898 Bytes
Versions: 45
Compression:
Stored size: 898 Bytes
Contents
module ActiveTools module ActionPack module ActionController module PathHelper module ComplexHelpers def path?(controller, action = nil) controller?(controller) && action?(action) end def action?(action) actions = case action when Array then action.map {|c| c.to_s} when String, Symbol then Array.wrap(action.to_s) else nil end actions.blank? ? true : current_action.in?(actions) end def controller?(controller) controllers = case controller when Array then controller.map {|c| c.to_s} when String, Symbol then Array.wrap(controller.to_s) else nil end controllers.blank? ? true : current_controller.in?(controllers) end end end end end end
Version data entries
45 entries across 45 versions & 1 rubygems