diff --git a/app/index.rb b/app/index.rb index b3a79676..1f5c46d0 100644 --- a/app/index.rb +++ b/app/index.rb @@ -50,10 +50,6 @@ get '/education' do erb :education, layout: :index_layout end -get '/tutorials' do - erb :'tutorials' -end - get '/donate' do erb :'donate' end @@ -89,4 +85,4 @@ end get '/thankyou' do erb :'thankyou' -end \ No newline at end of file +end diff --git a/app/tutorial.rb b/app/tutorial.rb new file mode 100644 index 00000000..4453594d --- /dev/null +++ b/app/tutorial.rb @@ -0,0 +1,26 @@ +get '/tutorials' do + erb :'tutorials' +end + +get '/tutorial/?' do + require_login + erb :'tutorial/index' +end + +get '/tutorial/:section/?' do + require_login + redirect "/tutorial/#{params[:section]}/1" +end + +get '/tutorial/:section/:page/?' do + require_login + @page = params[:page] + not_found if @page.to_i == 0 + not_found unless %w{html css js}.include?(params[:section]) + + @section = params[:section] + + @title = "#{params[:section].upcase} Tutorial - #{@page}/10" + + erb "tutorial/layout".to_sym +end diff --git a/views/tutorial/html/1.erb b/views/tutorial/html/1.erb new file mode 100644 index 00000000..672c5d0e --- /dev/null +++ b/views/tutorial/html/1.erb @@ -0,0 +1,30 @@ +
HTML is just a bunch of tags. There's usually an opening tag and a closing tag, with content between them like this:
+ +tag Content visible on your site /tag+ +
Don't worry if this seems confusing - you'll get the hang of it after a few more examples! If you ever get stuck, click the Help link below.
+HTML is just a bunch of tags. There's usually an opening tag and a closing tag, with content between them like this:
+ +tag Content visible on your site /tag+ +
Don't worry if this seems confusing - you'll get the hang of it after a few more examples! If you ever get stuck, click the Help link below.
+