The following controller private method
def set_promotion @promotion = Promotion.find(params[:id]) if !current_shopkeeper.nil? @current_user = User.where(