Merge pull request #5106 from consul/fix_budget_background_image

Render background images with brackets in their names
This commit is contained in:
Javi Martín
2023-06-30 17:20:56 +02:00
committed by GitHub
14 changed files with 71 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
<% if budget.image.present? %>
<div class="budget-header with-background-image"
style="background-image: url(<%= polymorphic_path(budget.image.variant(:large)) %>);">
style="<%= attached_background_css polymorphic_path(budget.image.variant(:large)) %>">
<% else %>
<div class="budget-header">
<% end %>

View File

@@ -1,5 +1,6 @@
class Budgets::BudgetComponent < ApplicationComponent
attr_reader :budget
delegate :attached_background_css, to: :helpers
def initialize(budget)
@budget = budget