Files
grecia/app/controllers/budgets_controller.rb
iagirre 0d9da5398b Fix banners in user pages
Banners were not been shown in certain pages; now
they are.

Spec to check if the banner is been shown correctly
added. Before it was in admins specs, now it has it's
own spec out of admins folder.
2018-07-12 10:17:25 -04:00

23 lines
626 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}, 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