Files
railsgoat/app/controllers/dashboard_controller.rb
T
Joseph Mastey 6e0a0a8312 feat(cops): clean rubocop run
1. ignoring one file because it's an intentional vuln
2. made a few small semantic changes, but verified that they're equivalent.
2017-12-06 17:14:25 -06:00

26 lines
515 B
Ruby

# frozen_string_literal: true
class DashboardController < ApplicationController
skip_before_action :has_info
layout false, only: [:change_graph]
def home
@user = current_user
# See if the user has a font preference
if params[:font]
cookies[:font] = params[:font]
end
end
def change_graph
self.try(params[:graph])
if params[:graph] == "bar_graph"
render "dashboard/bar_graph"
else
@user = current_user
render "dashboard/pie_charts"
end
end
end