Module: UsefulHelpers::Helpers::UrlHelper

Defined in:
lib/useful_helpers/helpers/url_helper.rb

Instance Method Summary collapse

Instance Method Details

#an(action) ⇒ Object



13
14
15
# File 'lib/useful_helpers/helpers/url_helper.rb', line 13

def an(action)
  action_name == action
end

#ca(controller, action) ⇒ Object



17
18
19
# File 'lib/useful_helpers/helpers/url_helper.rb', line 17

def ca(controller, action)
  params[:controller] == controller && action_name == action
end

#cn(controller) ⇒ Object



9
10
11
# File 'lib/useful_helpers/helpers/url_helper.rb', line 9

def cn(controller)
  params[:controller] == controller
end

#rc(prefix) ⇒ Object



5
6
7
# File 'lib/useful_helpers/helpers/url_helper.rb', line 5

def rc(prefix)
  request.request_uri.to_s.include?(prefix)
end

#st_w?(path) ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/useful_helpers/helpers/url_helper.rb', line 27

def st_w?(path)
  request.fullpath.start_with?(path)
end