app/controllers/decidim/admin/participatory_processes_controller.rb in decidim-admin-0.0.6 vs app/controllers/decidim/admin/participatory_processes_controller.rb in decidim-admin-0.0.7
- old
+ new
@@ -6,11 +6,10 @@
# Controller that allows managing participatory processes.
#
class ParticipatoryProcessesController < ApplicationController
helper_method :participatory_process
helper Decidim::OrganizationScopesHelper
- layout "decidim/admin/participatory_process", only: [:show, :edit, :update]
def index
authorize! :index, Decidim::ParticipatoryProcess
@participatory_processes = collection
end
@@ -39,20 +38,21 @@
def edit
@participatory_process = collection.find(params[:id])
authorize! :update, @participatory_process
@form = form(ParticipatoryProcessForm).from_model(@participatory_process)
+ render layout: "decidim/admin/participatory_process"
end
def update
@participatory_process = collection.find(params[:id])
authorize! :update, @participatory_process
@form = form(ParticipatoryProcessForm).from_params(params)
UpdateParticipatoryProcess.call(@participatory_process, @form) do
on(:ok) do |participatory_process|
flash[:notice] = I18n.t("participatory_processes.update.success", scope: "decidim.admin")
- redirect_to participatory_process_path(participatory_process)
+ redirect_to edit_participatory_process_path(participatory_process)
end
on(:invalid) do
flash.now[:alert] = I18n.t("participatory_processes.update.error", scope: "decidim.admin")
render :edit