README.rdoc in disguise-0.1.3 vs README.rdoc in disguise-0.2.0
- old
+ new
@@ -4,23 +4,30 @@
== Installation
sudo gem install disguise
== Setup
-Disguise comes with an admin controller to make changing your theme simple. By default it is not protected.
+Disguise comes with a couple of admin controllers to make changing your theme simple. By default they are not protected.
In order to prevent unauthorized users from changing your theme you can override the admin controller like this:
class Admin::ThemesController < Admin::Disguise::ThemesController
before_filter :login_required
layout('admin')
end
+ class Admin::DomainThemesController < Admin::Disguise::DomainThemesController
+ before_filter :login_required
+ layout('admin')
+ end
+
+
Also be sure to add a route to the new controller in routes.rb:
# admin
map.namespace :admin do |a|
a.resource :theme
+ a.resources :domain_themes
end
=== Rake tasks
Add disguise rake tasks to your rails project. Include the following line at the end of your Rakefile:
@@ -35,9 +42,14 @@
== Usage
Generate a new theme for your Rails application using the built in theme generator:
./script/generate theme theme_name
+Disguise can run in two modes. The first is the default which let's an administrator set the current theme
+via the built in admin interface. The second looks at the url of the incoming request and matches it to a theme.
+To enable this second mode create an initializer in /config/initializers/disguise.rb and enter the following contents:
+
+ USE_DOMAIN_FOR_THEMES = true
== Tests
Tests require the gem installed before running. In addition, if you change any of the code
you will need to run rake install before testing.