uses a module to structure controller code
This commit is contained in:
9
app/controllers/budgets/budgets_controller.rb
Normal file
9
app/controllers/budgets/budgets_controller.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
module Budgets
|
||||
class BudgetsController < ApplicationController
|
||||
skip_authorization_check
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -1,4 +1,4 @@
|
||||
class Budget
|
||||
module Budgets
|
||||
class InvestmentsController < ApplicationController
|
||||
skip_authorization_check
|
||||
|
||||
1
app/views/budgets/budgets/index.html.erb
Normal file
1
app/views/budgets/budgets/index.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
budgets index
|
||||
@@ -75,8 +75,10 @@ Rails.application.routes.draw do
|
||||
end
|
||||
end
|
||||
|
||||
namespace :budget do
|
||||
resources :investments, only: [:index]
|
||||
scope module: :budgets do
|
||||
resources :budgets do
|
||||
resources :investments, only: [:index]
|
||||
end
|
||||
end
|
||||
|
||||
resources :stats, only: [:index]
|
||||
|
||||
Reference in New Issue
Block a user