Class: ActionDispatch::Routing::Mapper

Inherits:
Object
  • Object
show all
Defined in:
lib/teamable/routes.rb

Instance Method Summary collapse

Instance Method Details

#teamable(teamable_path = nil, options = {}, &block) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/teamable/routes.rb', line 6

def teamable(teamable_path = nil, options = {}, &block)
  options = default_options(teamable_path, options)

  resource :personal_account, only: %i[], path: "onboarding" do
    get :setup, controller: options[:setup_controller], action: "new"
    post :setup, controller: options[:setup_controller], action: "create"
  end

  teamable_settings(options)

  scope "(/#{options[:path]}/:account_id)", account_id: %r{[^/]+} do
    yield block if block_given?
  end
end