Setup suggest action in investments controller
This commit is contained in:
@@ -20,7 +20,7 @@ module Budgets
|
||||
|
||||
has_orders %w{most_voted newest oldest}, only: :show
|
||||
has_orders ->(c) { c.instance_variable_get(:@budget).investments_orders }, only: :index
|
||||
has_filters %w{not_unfeasible feasible unfeasible unselected selected}, only: [:index, :show]
|
||||
has_filters %w{not_unfeasible feasible unfeasible unselected selected}, only: [:index, :show, :suggest]
|
||||
|
||||
invisible_captcha only: [:create, :update], honeypot: :subtitle, scope: :budget_investment
|
||||
|
||||
@@ -71,6 +71,12 @@ module Budgets
|
||||
end
|
||||
end
|
||||
|
||||
def suggest
|
||||
@resource_path_method = :namespaced_budget_investment_path
|
||||
@resource_relation = resource_model.where(budget: @budget).apply_filters_and_search(@budget, params, @current_filter)
|
||||
super
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def resource_model
|
||||
|
||||
Reference in New Issue
Block a user