Skip to content

Commit

Permalink
Fix breadcrumb item method
Browse files Browse the repository at this point in the history
  • Loading branch information
JoonasAapro committed Apr 5, 2024
1 parent 3f6a1a9 commit 44a2977
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 8 additions & 3 deletions app/controllers/decidim/iframe/blank_component_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ module Iframe
class BlankComponentController < Decidim::Components::BaseController
# just redirects to settings
def settings
redirect_to EngineRouter.admin_proxy(component.participatory_space).edit_component_path(id: component)
redirect_to EngineRouter.admin_proxy(current_component.participatory_space).edit_component_path(id: current_component)
end

private

def component
Decidim::Component.find(params[:component_id])
def set_component_breadcrumb_item
context_breadcrumb_items << {
label: current_component.name,
url: EngineRouter.admin_proxy(current_component.participatory_space).edit_component_path(id: current_component),
active: false,
resource: current_component
}
end
end
end
Expand Down
1 change: 0 additions & 1 deletion lib/decidim/iframe/admin_engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class AdminEngine < ::Rails::Engine

routes do
root to: "iframe#settings"
get "manage", to: "iframe#settings"
end

initializer "decidim_iframe.admin_mount_routes" do
Expand Down

0 comments on commit 44a2977

Please sign in to comment.