app/controllers/storytime/dashboard/roles_controller.rb in storytime-1.2.0 vs app/controllers/storytime/dashboard/roles_controller.rb in storytime-2.0.0
- old
+ new
@@ -1,13 +1,27 @@
require_dependency "storytime/application_controller"
module Storytime
module Dashboard
class RolesController < DashboardController
+ before_action :load_roles
+ respond_to :json
+
+ def edit_multiple
+ authorize @current_storytime_site, :update?
+ render :edit
+ end
+
def update_multiple
- authorize @site, :update?
+ authorize @current_storytime_site, :update?
@roles = Storytime::Role.update(params[:roles].keys, params[:roles].values)
- redirect_to storytime.edit_dashboard_site_path(@site), notice: I18n.t("flash.roles.update.success")
+ render :edit
+ end
+
+ private
+ def load_roles
+ @roles = Storytime::Role.all
+ @actions = Storytime::Action.all
end
end
end
end
\ No newline at end of file