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.
18 lines
377 B
Ruby
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
|