-
-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow custom routing for admin backend
- Loading branch information
Showing
7 changed files
with
107 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Provides admin interface routing configuration accessors. | ||
# | ||
# Alchemy has some defaults for admin path and admin constraints: | ||
# | ||
# +Alchemy.admin_path defaults to +'/admin'+ | ||
# +Alchemy.admin_constraints defaults to +{}+ | ||
# | ||
# Anyway, you can tell Alchemy about your routing configuration: | ||
# | ||
# 1. The path to the admin panel - @see: Alchemy.admin_path | ||
# 2. The constraints for the admin panel (like subdomain) - @see: Alchemy.admin_constraints | ||
# | ||
# A word of caution: you need to know what you are doing if you set admin_path to ''. This can cause | ||
# routing name clashes, e.g. a page named 'dashboard' will clash with the Alchemy dashboard. | ||
# | ||
# == Example | ||
# | ||
# If you do not wish to use the default admin interface routing ('example.com/admin/') | ||
# and prefer e.g. 'hidden.example.com/backend/', those are the settings you need: | ||
# | ||
# # config/initializers/alchemy.rb | ||
# Alchemy.admin_path = '/backend' | ||
# Alchemy.admin_constraints = {subdomain: 'hidden'} | ||
# | ||
module Alchemy | ||
mattr_accessor :admin_path, :admin_constraints | ||
|
||
# Defaults | ||
# | ||
@@admin_path = '/admin' | ||
@@admin_constraints = {} | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require 'spec_helper' | ||
|
||
module Alchemy | ||
describe 'Paths' do | ||
describe 'defaults' do | ||
it 'has default value for Alchemy.admin_path' do | ||
expect(Alchemy.admin_path).to eq('/admin') | ||
end | ||
|
||
it 'has default value for Alchemy.admin_constraints' do | ||
expect(Alchemy.admin_constraints).to eq({}) | ||
end | ||
end | ||
end | ||
end |
What is this route? There doesn't seem to be a matching
Alchemy::ContentsController
?