mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 18:46:22 +00:00
no fallar si el intervalo está vacío
This commit is contained in:
parent
6c485e5e18
commit
7ab2ec5933
2 changed files with 2 additions and 2 deletions
|
@ -137,7 +137,7 @@ class StatsController < ApplicationController
|
|||
# @return [Symbol]
|
||||
def interval
|
||||
@interval ||= begin
|
||||
i = params[:interval].to_sym
|
||||
i = params[:interval]&.to_sym
|
||||
Stat::INTERVALS.include?(i) ? i : :day
|
||||
end
|
||||
end
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
.mb-3
|
||||
- Stat::INTERVALS.each do |interval|
|
||||
= link_to t(".#{interval}"), site_stats_path(interval: interval, urls: params[:urls]), class: "btn #{'btn-primary active' if params[:interval].to_sym == interval}"
|
||||
= link_to t(".#{interval}"), site_stats_path(interval: interval, urls: params[:urls]), class: "btn #{'btn-primary active' if @interval == interval}"
|
||||
|
||||
.mb-3
|
||||
%h2= t('.host.title', count: @hostnames.size)
|
||||
|
|
Loading…
Reference in a new issue