consolidated_plugin.rb
上传用户:netsea168
上传日期:2022-07-22
资源大小:4652k
文件大小:1k
- class Sidebars::ConsolidatedPlugin < Sidebars::Plugin
- class << self
- @abstract = true
- def fields
- associated_class.fields
- end
- def default_config
- fields.inject({ }) do |acc, item|
- acc.merge(item.key => item.default)
- end
- end
- def description
- associated_class.description
- end
- end
- def index
- @sidebar = params['sidebar']
- @sb_config = @sidebar.config
- @sidebar.parse_request(params)
- render :partial => "sidebars/#{@sidebar.short_name}/content"
- end
- end