Files
grecia/app/components/proposals/form_component.rb
Javi Martín 67e00654bd Extract methods to get map location in form components
This way changing them will be easier.
2025-11-17 15:28:57 +01:00

23 lines
444 B
Ruby

class Proposals::FormComponent < ApplicationComponent
include TranslatableFormHelper
include GlobalizeHelper
attr_reader :proposal, :url
use_helpers :current_user, :suggest_data, :geozone_select_options
def initialize(proposal, url:)
@proposal = proposal
@url = url
end
private
def categories
Tag.category.order(:name)
end
def map_location
proposal.map_location || MapLocation.new
end
end