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.
11 lines
227 B
Ruby
11 lines
227 B
Ruby
class Admin::Widget::CardsController < Admin::BaseController
|
|
include Admin::Widget::CardsActions
|
|
load_and_authorize_resource :card, class: "Widget::Card"
|
|
|
|
private
|
|
|
|
def index_path
|
|
admin_homepage_path
|
|
end
|
|
end
|