Setup suggest action in investments controller

This commit is contained in:
Eduardo Martinez Echevarria
2017-06-11 14:04:02 +02:00
parent 0aa2cd99ac
commit 89d2793d76

View File

@@ -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