Class: RailsBestPractices::Core::Routes

Inherits:
Array
  • Object
show all
Defined in:
lib/rails_best_practices/core/routes.rb

Instance Method Summary collapse

Instance Method Details

#add_route(namespaces, controller_name, action_name) ⇒ Object

add a route.

Parameters:

  • namesapces (Array)
  • controller (String)

    name

  • action (String)

    name



10
11
12
13
14
# File 'lib/rails_best_practices/core/routes.rb', line 10

def add_route(namespaces, controller_name, action_name)
  if namespaces.present? || controller_name.present?
    self << Route.new(namespaces, controller_name, action_name)
  end
end