Sha256: 1c60f825ddad029a30e77f0fbc4045a0c2b412738d70ffe02aef2e6eb690ce21
Contents?: true
Size: 843 Bytes
Versions: 7
Compression:
Stored size: 843 Bytes
Contents
# frozen_string_literal: true module Decidim # The controller to handle the user's interests page. class UserInterestsController < Decidim::ApplicationController include Decidim::UserProfile def show enforce_permission_to(:read, :user, current_user:) @user_interests = form(UserInterestsForm).from_model(current_user) end def update enforce_permission_to(:update, :user, current_user:) @user_interests = form(UserInterestsForm).from_params(params) UpdateUserInterests.call(@user_interests) do on(:ok) do flash.keep[:notice] = t("user_interests.update.success", scope: "decidim") end on(:invalid) do flash.keep[:alert] = t("user_interests.update.error", scope: "decidim") end end redirect_to action: :show end end end
Version data entries
7 entries across 7 versions & 1 rubygems