Dashboard Location plugin
Plugin details
Documentation
ruby script/plugin install git://github.com/zachinglis/rails-plugins.git
In controllers such as sessions_controller where you want people to be using the subdomain, use:
before_filter :should_add_subdomain_for_home_if_logged_in
before_filter :protect_controller_if_no_dashboard
For controllers that should not be accessed through a subdomain, such as content controllers, use:
before_filter :redirect_dashboard_calls
That is it! Just use methods like logged_in anywhere you like and it will work as you hope.
Installation:
Drag the dashboard_location.rb to your lib folder in your Rails directory.
Perform:
ruby ./script/generate model Home permalink:string name:string
I use this in conjunction with Technoweenies permalink_fu to automatically generate the permalink. If you want to add the following code, else skip it:
has_permalink :name
Add this to your signup process. Ryan address how to do similiar things here: http://railscasts.com/episodes/75
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | (0 older versions) | Last edited by: hardway, 8 months ago

