Add name attribute to heading content blocks

This way we can simplify the code and don't have to rely on `.try`
statements which are confusing and so we don't allow them in the
`Rails/SafeNavigation` Rubocop rule.
This commit is contained in:
Javi Martín
2020-09-30 22:10:59 +02:00
parent 2d37a0396b
commit 0911b89d16
5 changed files with 18 additions and 3 deletions

View File

@@ -77,7 +77,7 @@ class Admin::SiteCustomization::ContentBlocksController < Admin::SiteCustomizati
if @content_block.is_a? Budget::ContentBlock
@selected_content_block = "hcb_#{@content_block.heading_id}"
else
@selected_content_block = @content_block.heading.name
@selected_content_block = @content_block.name
end
@is_heading_content_block = true
render :edit