Skip to content
This repository was archived by the owner on Jul 7, 2020. It is now read-only.

Commit 2707ca8

Browse files
committed
Added resource controllers
1 parent c15d0ed commit 2707ca8

13 files changed

+52
-0
lines changed

Diff for: app/controllers/backend/application_controller.rb

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class Backend::ApplicationController < ActionController::Base
2+
protect_from_forgery
3+
end

Diff for: app/controllers/backend/products_controller.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class Backend::ProductsController < Backend::ResourceController
2+
end

Diff for: app/controllers/backend/resource_controller.rb

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class Backend::ResourceController < Backend::ApplicationController
2+
inherit_resources
3+
respond_to :html
4+
end

Diff for: app/helpers/backend/application_helper.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module Backend::ApplicationHelper
2+
end

Diff for: app/helpers/backend/products_helper.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module Backend::ProductsHelper
2+
end

Diff for: app/helpers/backend/resource_helper.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module Backend::ResourceHelper
2+
end

Diff for: config/routes.rb

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
SimpleBackendExample::Application.routes.draw do
22
root to: "home#index"
3+
namespace :backend do
4+
root to: "products#index"
5+
resources :products
6+
end
37
end
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require 'test_helper'
2+
3+
class Backend::ApplicationControllerTest < ActionController::TestCase
4+
# test "the truth" do
5+
# assert true
6+
# end
7+
end

Diff for: test/functional/backend/products_controller_test.rb

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require 'test_helper'
2+
3+
class Backend::ProductsControllerTest < ActionController::TestCase
4+
# test "the truth" do
5+
# assert true
6+
# end
7+
end

Diff for: test/functional/backend/resource_controller_test.rb

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require 'test_helper'
2+
3+
class Backend::ResourceControllerTest < ActionController::TestCase
4+
# test "the truth" do
5+
# assert true
6+
# end
7+
end

Diff for: test/unit/helpers/backend/application_helper_test.rb

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
require 'test_helper'
2+
3+
class Backend::ApplicationHelperTest < ActionView::TestCase
4+
end

Diff for: test/unit/helpers/backend/products_helper_test.rb

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
require 'test_helper'
2+
3+
class Backend::ProductsHelperTest < ActionView::TestCase
4+
end

Diff for: test/unit/helpers/backend/resource_helper_test.rb

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
require 'test_helper'
2+
3+
class Backend::ResourceHelperTest < ActionView::TestCase
4+
end

0 commit comments

Comments
 (0)