Sha256: de0773747288ca167c632b0f4c589aade33676efea6c42cfcf07b99292403594
Contents?: true
Size: 922 Bytes
Versions: 17
Compression:
Stored size: 922 Bytes
Contents
# frozen_string_literal: true module Decidim module Pages module Admin # This controller allows the user to update a Page. class PagesController < Admin::ApplicationController def edit @form = form(Admin::PageForm).from_model(page) end def update @form = form(Admin::PageForm).from_params(params) Admin::UpdatePage.call(@form, page) do on(:ok) do flash[:notice] = I18n.t("pages.update.success", scope: "decidim.pages.admin") redirect_to parent_path end on(:invalid) do flash.now[:alert] = I18n.t("pages.update.invalid", scope: "decidim.pages.admin") render action: "edit" end end end private def page @page ||= Pages::Page.find_by(feature: current_feature) end end end end end
Version data entries
17 entries across 17 versions & 2 rubygems