diff --git a/app/controllers/cards/collections_controller.rb b/app/controllers/cards/collections_controller.rb index 7d3ff8b9b..cd709fb25 100644 --- a/app/controllers/cards/collections_controller.rb +++ b/app/controllers/cards/collections_controller.rb @@ -2,15 +2,19 @@ class Cards::CollectionsController < ApplicationController include CollectionScoped skip_before_action :set_collection, only: %i[ edit ] + before_action :set_card def edit - @card = Current.user.accessible_cards.find(params[:card_id]) @collections = Current.user.collections.ordered_by_recently_accessed end def update - @card = Current.user.accessible_cards.find(params[:card_id]) @card.move_to(@collection) redirect_to @card end + + private + def set_card + @card = Current.user.accessible_cards.find(params[:card_id]) + end end