Plugins - Dashboard Engine
Add to favoritesDashboardEngine is a rails engine that reads through all the controllers, obtains views from each of them which are candidates for being on dashboard, collects the parameters for the view (if any), and puts all of them on the dashboard settings page.
Usage:
1) Views without parameters.
class MyController < ApplicationController
dashboard_actions :action1, :action2, :action3
...
end
2) Views with parameters.
class MyController < ApplicationController
dashboard_actions (:action1, {:action2 => [:param1, :param2]})
...
end
This software package is developed using the Engines plugin. To find out more about how to use engines in general, go to http://rails-engines.rubyforge.org for general documentation about the Engines mechanism.
Installation
- Create your Rails application, set up your databases, grab the Engines plugin and the DashboardEngine, and install them.
- Install the DashboardEngine into your vendor/plugins directory
You can do it using, ruby script/plugin install svn://rubyforge.org/var/svn/dashboardengine/trunk
Then rename the engine from dashboardengine to dashboard_engine. mv vendor/plugins/dashboardengine/ vendor/plugins/dashboard_engine/
REASON:
*) By convention engines are named xyz_engine. *) RubyForge doesnot allow any underscores '_' in project names. *) DashboardEngine is hosted on RubyForge. - Modify your Engines.start call in config/environment.rb
Engines.start :dashboard # or :dashboard_engine
- Edit your application.rb file so it looks something like the following:
class ApplicationController < ActionController::Base include DashboardEngine end
- Edit your application_helper.rb file:
module ApplicationHelper include DashboardEngine end
- Perform any configuration you might need. You’ll probably want to set
these values in environment.rb (before the call to Engines.start):
module DashboardEngine config :some_option, "some_value" end
- Initialize the database tables. You can either use the engine migrations by
calling:
rake engine_migrate to move all engines to their latest versions, or rake engine_migrate ENGINE=dashboard to migrate only this engine. - The DashboardEngine provides a default stylesheet and a small javascript
helper file, so you’ll probably want to include the former and almost
certainly the latter in your application’s layout. Add the following
lines:
<%= engine_stylesheet "dashboard_engine" %> <%= engine_javascript "dashboard_engine" %>
Configuration
A number of configuration parameters are available to allow to you control how the data is stored, should you be unhappy with the defaults. These are outlined below.
module DashboardEngine
config :some_option, "some_value"
end
