Files
nairobi/app/controllers/admin/site_customization/cards_controller.rb
Javi Martín 4c0bb894eb Use polymorphic routes to manage cards
We use a different logic to load the card depending on the controller
we're using, and then share the rest of the code. This way we simplify
the code a bit, since we don't have to check for the page_id parameter.
2021-01-12 14:50:37 +01:00

15 lines
399 B
Ruby

class Admin::SiteCustomization::CardsController < Admin::SiteCustomization::BaseController
include Admin::Widget::CardsActions
load_and_authorize_resource :page, class: "::SiteCustomization::Page"
load_and_authorize_resource :card, through: :page, class: "Widget::Card"
def index
end
private
def index_path
admin_site_customization_page_widget_cards_path(@page)
end
end