only render tutorial page if number 1-10

This commit is contained in:
Kyle Drake 2024-02-16 14:07:29 -06:00
parent 1beedb79b1
commit 4ffeddaf5a

View file

@ -31,7 +31,7 @@ end
get '/tutorial/:section/:page/?' do get '/tutorial/:section/:page/?' do
require_login require_login
@page = params[:page] @page = params[:page]
not_found if @page.to_i == 0 not_found unless @page.match?(/\A[1-9]\z|\A10\z/)
not_found unless %w{html css js}.include?(params[:section]) not_found unless %w{html css js}.include?(params[:section])
@section = params[:section] @section = params[:section]