diff --git a/app/controllers/errors_controller.rb b/app/controllers/errors_controller.rb new file mode 100644 index 00000000..bfeb105b --- /dev/null +++ b/app/controllers/errors_controller.rb @@ -0,0 +1,23 @@ +# BigBlueButton open source conferencing system - http://www.bigbluebutton.org/. +# +# Copyright (c) 2016 BigBlueButton Inc. and by respective authors (see below). +# +# This program is free software; you can redistribute it and/or modify it under the +# terms of the GNU Lesser General Public License as published by the Free Software +# Foundation; either version 3.0 of the License, or (at your option) any later +# version. +# +# BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License along +# with BigBlueButton; if not, see . + +class ErrorsController < ApplicationController + def error + end + + def not_found + end +end diff --git a/app/views/errors/error.html.erb b/app/views/errors/error.html.erb index 9ecc15fe..bda04a95 100644 --- a/app/views/errors/error.html.erb +++ b/app/views/errors/error.html.erb @@ -13,5 +13,7 @@ # with BigBlueButton; if not, see . %> -

Errors#error

-

Find me in app/views/errors/error.html.erb

+
+

<%= t('error_title') %>

+ <%= link_to t('home_page'), root_url %> +
diff --git a/app/views/errors/not_found.html.erb b/app/views/errors/not_found.html.erb new file mode 100644 index 00000000..cbf91d0b --- /dev/null +++ b/app/views/errors/not_found.html.erb @@ -0,0 +1,19 @@ +<% +# BigBlueButton open source conferencing system - http://www.bigbluebutton.org/. +# Copyright (c) 2016 BigBlueButton Inc. and by respective authors (see below). +# This program is free software; you can redistribute it and/or modify it under the +# terms of the GNU Lesser General Public License as published by the Free Software +# Foundation; either version 3.0 of the License, or (at your option) any later +# version. +# +# BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. +# You should have received a copy of the GNU Lesser General Public License along +# with BigBlueButton; if not, see . +%> + +
+

<%= t('not_found_title') %>

+ <%= link_to t('home_page'), root_url %> +
diff --git a/config/locales/en-us.yml b/config/locales/en-us.yml index 7e4b8ff1..a4097b5d 100644 --- a/config/locales/en-us.yml +++ b/config/locales/en-us.yml @@ -71,9 +71,11 @@ en-US: end: End enter_name: Enter your name enter_meeting_name: Enter a meeting name to start + error_title: An error has occured footer_html: Powered by %{bbb_link} help: Help hi_all: Hi Everyone + home_page: Home page home_title: Welcome to BigBlueButton invite: Invite invite_description: (share this link below to invite others to this meeting) @@ -101,6 +103,7 @@ en-US: my_room: my room name: Name 'no': 'No' + not_found_title: Sorry we couldn't find that. notification_mailer: recording_ready_email: closing: "Regards,... BigBlueButton" diff --git a/config/routes.rb b/config/routes.rb index f4897097..96fe49c9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -18,6 +18,10 @@ Rails.application.routes.draw do mount ActionCable.server => '/cable' + match '/404', to: 'errors#not_found', via: :all + match '/500', to: 'errors#error', via: :all + match '/422', to: 'errors#error', via: :all + resources :users, only: [:edit, :update] get '/users/login', to: 'sessions#new', as: :user_login get '/users/logout', to: 'sessions#destroy', as: :user_logout diff --git a/public/404.html b/public/404.html deleted file mode 100644 index b612547f..00000000 --- a/public/404.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - The page you were looking for doesn't exist (404) - - - - - - -
-
-

The page you were looking for doesn't exist.

-

You may have mistyped the address or the page may have moved.

-
-

If you are the application owner check the logs for more information.

-
- - diff --git a/public/422.html b/public/422.html deleted file mode 100644 index a21f82b3..00000000 --- a/public/422.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - The change you wanted was rejected (422) - - - - - - -
-
-

The change you wanted was rejected.

-

Maybe you tried to change something you didn't have access to.

-
-

If you are the application owner check the logs for more information.

-
- - diff --git a/public/500.html b/public/500.html deleted file mode 100644 index 061abc58..00000000 --- a/public/500.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - We're sorry, but something went wrong (500) - - - - - - -
-
-

We're sorry, but something went wrong.

-
-

If you are the application owner check the logs for more information.

-
- - diff --git a/test/controllers/errors_controller_test.rb b/test/controllers/errors_controller_test.rb new file mode 100644 index 00000000..b5677787 --- /dev/null +++ b/test/controllers/errors_controller_test.rb @@ -0,0 +1,14 @@ +require 'test_helper' + +class ErrorsControllerTest < ActionController::TestCase + test "should get not_found" do + get :not_found + assert_response :success + end + + test "should get error" do + get :error + assert_response :success + end + +end