Files
grecia/app/components/proposals/form_component.rb
Javi Martín 4150d7f1be Move proposals form partial to a component
Since now categories are loaded in both the investment form component
and proposal form component, and their controllers are the only
"commentable" controllers using the `@categories` instance variable, we
can remove the `load_categories` call in `CommentableActions` affecting
the create and update actions.
2021-07-13 15:25:29 +02:00

18 lines
377 B
Ruby

class Proposals::FormComponent < ApplicationComponent
include TranslatableFormHelper
include GlobalizeHelper
attr_reader :proposal, :url
delegate :current_user, :suggest_data, :geozone_select_options, to: :helpers
def initialize(proposal, url:)
@proposal = proposal
@url = url
end
private
def categories
Tag.category.order(:name)
end
end