Class: Decidim::DecidimAwesome::Admin::CustomRedirectsController
Overview
Constant Summary
Decidim::DecidimAwesome::Admin::ConfigConstraintsHelpers::OTHER_MANIFESTS
Instance Method Summary
collapse
#check, #component_manifests, #components_list, #enabled_configs, #md5, #participatory_space_manifests, #participatory_spaces_list, #translate_constraint_value
extended, included
#permission_class_chain
Instance Method Details
#create ⇒ Object
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'app/controllers/decidim/decidim_awesome/admin/custom_redirects_controller.rb', line 28
def create
@form = form(CustomRedirectForm).from_params(params)
CreateCustomRedirect.call(@form) do
on(:ok) do
flash[:notice] = I18n.t("custom_redirects.create.success", scope: "decidim.decidim_awesome.admin")
redirect_to decidim_admin_decidim_awesome.custom_redirects_path
end
on(:invalid) do |message|
flash.now[:alert] = I18n.t("custom_redirects.create.error", error: message, scope: "decidim.decidim_awesome.admin")
render :new
end
end
end
|
#destroy ⇒ Object
58
59
60
61
62
63
64
65
66
67
68
|
# File 'app/controllers/decidim/decidim_awesome/admin/custom_redirects_controller.rb', line 58
def destroy
DestroyCustomRedirect.call(redirect_item, current_organization) do
on(:ok) do
flash[:notice] = I18n.t("custom_redirects.destroy.success", scope: "decidim.decidim_awesome.admin")
end
on(:invalid) do |error|
flash[:alert] = I18n.t("custom_redirects.destroy.error", scope: "decidim.decidim_awesome.admin", error:)
end
end
redirect_to decidim_admin_decidim_awesome.custom_redirects_path
end
|
#edit ⇒ Object
24
25
26
|
# File 'app/controllers/decidim/decidim_awesome/admin/custom_redirects_controller.rb', line 24
def edit
@form = form(CustomRedirectForm).from_model(redirect_item)
end
|
#index ⇒ Object
18
|
# File 'app/controllers/decidim/decidim_awesome/admin/custom_redirects_controller.rb', line 18
def index; end
|
#new ⇒ Object
20
21
22
|
# File 'app/controllers/decidim/decidim_awesome/admin/custom_redirects_controller.rb', line 20
def new
@form = form(CustomRedirectForm).instance
end
|
#update ⇒ Object
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
# File 'app/controllers/decidim/decidim_awesome/admin/custom_redirects_controller.rb', line 43
def update
@form = form(CustomRedirectForm).from_params(params)
UpdateCustomRedirect.call(@form, redirect_item) do
on(:ok) do
flash[:notice] = I18n.t("custom_redirects.update.success", scope: "decidim.decidim_awesome.admin")
redirect_to decidim_admin_decidim_awesome.custom_redirects_path
end
on(:invalid) do |message|
flash.now[:alert] = I18n.t("custom_redirects.update.error", error: message, scope: "decidim.decidim_awesome.admin")
render :new
end
end
end
|