Class: Admin::PluginsController
- Inherits:
-
StaffController
- Object
- StaffController
- Admin::PluginsController
- Defined in:
- app/controllers/admin/plugins_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
4 5 6 7 8 9 10 |
# File 'app/controllers/admin/plugins_controller.rb', line 4 def index render_serialized( Discourse.plugins_sorted_by_name(enabled_only: false), AdminPluginSerializer, root: "plugins", ) end |
#show ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/admin/plugins_controller.rb', line 12 def show plugin = Discourse.plugins_by_name[params[:plugin_id]] # An escape hatch in case a plugin is using an un-prefixed # version of their plugin name for a route. plugin = Discourse.plugins_by_name["discourse-#{params[:plugin_id]}"] if !plugin raise Discourse::NotFound if !plugin&.visible? render_serialized(plugin, AdminPluginSerializer, root: nil) end |