Files
nairobi/app/controllers/budgets_controller.rb
Julian Herrero c9522b424b Show unfeasible and unselected investments for finished budgets
We were filtering by winners investments for finished budget without
having in consideration other filters.
We want the default filter to be `winners` for finished budgets.
2019-02-06 13:50:50 +01:00

23 lines
634 B
Ruby

class BudgetsController < ApplicationController
include FeatureFlags
include BudgetsHelper
feature_flag :budgets
load_and_authorize_resource
before_action :set_default_budget_filter, only: :show
has_filters %w[not_unfeasible feasible unfeasible unselected selected winners], only: :show
respond_to :html, :js
def show
raise ActionController::RoutingError, 'Not Found' unless budget_published?(@budget)
end
def index
@finished_budgets = @budgets.finished.order(created_at: :desc)
@budgets_coordinates = current_budget_map_locations
@banners = Banner.in_section('budgets').with_active
end
end