forked from External/greenlight
handle errors and fix join form
This commit is contained in:
parent
2b0f75e62b
commit
2b065eb7fa
|
@ -0,0 +1,3 @@
|
||||||
|
# Place all the behaviors and hooks related to the matching controller here.
|
||||||
|
# All this logic will automatically be available in application.js.
|
||||||
|
# You can use CoffeeScript in this file: http://coffeescript.org/
|
|
@ -85,6 +85,13 @@ a {
|
||||||
width: 60%;
|
width: 60%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.center-page {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left:50%;
|
||||||
|
transform: translate(-50%,-50%);
|
||||||
|
}
|
||||||
|
|
||||||
iframe{
|
iframe{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
// Place all the styles related to the Errors controller here.
|
||||||
|
// They will automatically be included in application.css.
|
||||||
|
// You can use Sass (SCSS) here: http://sass-lang.com/
|
|
@ -35,14 +35,6 @@ class ApplicationController < ActionController::Base
|
||||||
end
|
end
|
||||||
helper_method :allow_greenlight_users?
|
helper_method :allow_greenlight_users?
|
||||||
|
|
||||||
# Generate a URL to start a meeting.
|
|
||||||
def owner_meeting_url
|
|
||||||
opts = default_meeting_options
|
|
||||||
opts[:user_is_moderator] = true
|
|
||||||
@room.meeting.join_path(current_user.name, opts)
|
|
||||||
end
|
|
||||||
helper_method :owner_meeting_url
|
|
||||||
|
|
||||||
# Determines if a form field needs the is-invalid class.
|
# Determines if a form field needs the is-invalid class.
|
||||||
def form_is_invalid?(obj, key)
|
def form_is_invalid?(obj, key)
|
||||||
'is-invalid' if !obj.errors.messages[key].empty?
|
'is-invalid' if !obj.errors.messages[key].empty?
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
class ErrorsController < ApplicationController
|
||||||
|
|
||||||
|
def not_found
|
||||||
|
render status: 404
|
||||||
|
end
|
||||||
|
|
||||||
|
def unprocessable
|
||||||
|
render status: 422
|
||||||
|
end
|
||||||
|
|
||||||
|
def internal_error
|
||||||
|
render status: 500
|
||||||
|
end
|
||||||
|
end
|
|
@ -35,14 +35,18 @@ class RoomsController < ApplicationController
|
||||||
opts = default_meeting_options
|
opts = default_meeting_options
|
||||||
|
|
||||||
# Assign join name if passed.
|
# Assign join name if passed.
|
||||||
if params[@room.invite_path]
|
if params[@room.invite_path][:join_name]
|
||||||
@join_name = params[@room.invite_path][:join_name]
|
@join_name = params[@room.invite_path][:join_name]
|
||||||
|
else
|
||||||
|
# Join name not passed.
|
||||||
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if @room.is_running?
|
if @room.is_running?
|
||||||
if current_user
|
if current_user
|
||||||
redirect_to @room.join_path(current_user, opts)
|
redirect_to @room.join_path(current_user.name, opts, current_user.uid)
|
||||||
elsif join_name = params[:join_name] || params[@room.invite_path][:join_name]
|
else
|
||||||
|
join_name = params[@room.invite_path][:join_name]
|
||||||
redirect_to @room.join_path(join_name, opts)
|
redirect_to @room.join_path(join_name, opts)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@ -65,7 +69,7 @@ class RoomsController < ApplicationController
|
||||||
opts = default_meeting_options
|
opts = default_meeting_options
|
||||||
opts[:user_is_moderator] = true
|
opts[:user_is_moderator] = true
|
||||||
|
|
||||||
redirect_to @room.join_path(current_user, opts)
|
redirect_to @room.join_path(current_user.name, opts, current_user.uid)
|
||||||
|
|
||||||
# Notify users that the room has started.
|
# Notify users that the room has started.
|
||||||
# Delay 5 seconds to allow for server start, although the request will retry until it succeeds.
|
# Delay 5 seconds to allow for server start, although the request will retry until it succeeds.
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
module ErrorsHelper
|
||||||
|
end
|
|
@ -7,7 +7,6 @@ class Room < ApplicationRecord
|
||||||
belongs_to :owner, class_name: 'User', foreign_key: :user_id
|
belongs_to :owner, class_name: 'User', foreign_key: :user_id
|
||||||
has_one :meeting
|
has_one :meeting
|
||||||
|
|
||||||
ROOM_ICONS = %w(circle star certificate play cloud heart square bookmark cog)
|
|
||||||
RETURNCODE_SUCCESS = "SUCCESS"
|
RETURNCODE_SUCCESS = "SUCCESS"
|
||||||
|
|
||||||
# Determines if a user owns a room.
|
# Determines if a user owns a room.
|
||||||
|
@ -21,19 +20,6 @@ class Room < ApplicationRecord
|
||||||
bbb.is_meeting_running?(bbb_id)
|
bbb.is_meeting_running?(bbb_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Retrieves all the users in a room.
|
|
||||||
def participants
|
|
||||||
begin
|
|
||||||
res = bbb.get_meeting_info(bbb_id, nil)
|
|
||||||
res[:attendees].map do |att|
|
|
||||||
User.find_by(uid: att[:userID], name: att[:fullName])
|
|
||||||
end
|
|
||||||
rescue BigBlueButton::BigBlueButtonException => exc
|
|
||||||
# The meeting is most likely not running.
|
|
||||||
[]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Determines the invite URL for the room.
|
# Determines the invite URL for the room.
|
||||||
def invite_path
|
def invite_path
|
||||||
"/r/#{uid}"
|
"/r/#{uid}"
|
||||||
|
@ -68,7 +54,7 @@ class Room < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns a URL to join a user into a meeting.
|
# Returns a URL to join a user into a meeting.
|
||||||
def join_path(user, options = {})
|
def join_path(name, options = {}, uid = nil)
|
||||||
# Create the meeting if it isn't running.
|
# Create the meeting if it isn't running.
|
||||||
start_session(options) unless is_running?
|
start_session(options) unless is_running?
|
||||||
|
|
||||||
|
@ -95,10 +81,10 @@ class Room < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
# Generate the join URL.
|
# Generate the join URL.
|
||||||
if user.is_a?(User)
|
if uid
|
||||||
bbb.join_meeting_url(bbb_id, user.name, password, {userID: user.uid})
|
bbb.join_meeting_url(bbb_id, name, password, {userID: uid})
|
||||||
else
|
else
|
||||||
bbb.join_meeting_url(bbb_id, user, password)
|
bbb.join_meeting_url(bbb_id, name, password)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -109,6 +95,19 @@ class Room < ApplicationRecord
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Retrieves all the users in a room.
|
||||||
|
def participants
|
||||||
|
begin
|
||||||
|
res = bbb.get_meeting_info(bbb_id, nil)
|
||||||
|
res[:attendees].map do |att|
|
||||||
|
User.find_by(uid: att[:userID], name: att[:fullName])
|
||||||
|
end
|
||||||
|
rescue BigBlueButton::BigBlueButtonException => exc
|
||||||
|
# The meeting is most likely not running.
|
||||||
|
[]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Fetches all recordings for a meeting.
|
# Fetches all recordings for a meeting.
|
||||||
def recordings
|
def recordings
|
||||||
res = bbb.get_recordings(meetingID: bbb_id)
|
res = bbb.get_recordings(meetingID: bbb_id)
|
||||||
|
@ -168,8 +167,6 @@ class Room < ApplicationRecord
|
||||||
def setup
|
def setup
|
||||||
self.uid = [owner.firstname, (0...9).map { (65 + rand(26)).chr }.join].join('-').downcase
|
self.uid = [owner.firstname, (0...9).map { (65 + rand(26)).chr }.join].join('-').downcase
|
||||||
self.bbb_id = Digest::SHA1.hexdigest(Rails.application.secrets[:secret_key_base] + Time.now.to_i.to_s).to_s
|
self.bbb_id = Digest::SHA1.hexdigest(Rails.application.secrets[:secret_key_base] + Time.now.to_i.to_s).to_s
|
||||||
|
|
||||||
self.icon = ROOM_ICONS.sample
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Rereives the loadbalanced BigBlueButton credentials for a user.
|
# Rereives the loadbalanced BigBlueButton credentials for a user.
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
<div class="text-center center-page">
|
||||||
|
<h1 class="display-2 font-weight-400">Oh no!</h1>
|
||||||
|
<h3>Looks like something went wrong on our end.</h3>
|
||||||
|
<%= link_to root_url do %>
|
||||||
|
<h4>Return to home page.</h4>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
|
@ -0,0 +1,8 @@
|
||||||
|
<div class="text-center center-page">
|
||||||
|
<h1 class="display-2 font-weight-400">Whoops!</h1>
|
||||||
|
<h2>Looks like we can't find that resource.</h2>
|
||||||
|
<h3>Is it possible its been removed?</h3>
|
||||||
|
<%= link_to root_url do %>
|
||||||
|
<h4>Return to home page.</h4>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
|
@ -0,0 +1,7 @@
|
||||||
|
<div class="text-center center-page">
|
||||||
|
<h1 class="display-2 font-weight-400">Oops!</h1>
|
||||||
|
<h3>Request is unprocessable.</h3>
|
||||||
|
<%= link_to root_url do %>
|
||||||
|
<h4>Return to home page.</h4>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
|
@ -1,7 +1,12 @@
|
||||||
<%= render 'shared/room_event' do %>
|
<%= render 'shared/room_event' do %>
|
||||||
<%= form_for room_path, method: :post do |f| %>
|
<%= form_for room_path, method: :post do |f| %>
|
||||||
<div class="input-group" style="height: 48px;">
|
<div class="input-group" style="height: 48px;">
|
||||||
<%= f.text_field :join_name, class: "form-control main-large", placeholder: "Enter your name!", value: "#{current_user ? current_user.name : ''}" %>
|
<%= f.text_field :join_name,
|
||||||
|
required: true,
|
||||||
|
class: "form-control main-large",
|
||||||
|
placeholder: "Enter your name!",
|
||||||
|
value: "#{current_user ? current_user.name : ''}",
|
||||||
|
readonly: !current_user.nil? %>
|
||||||
<span class="input-group-append">
|
<span class="input-group-append">
|
||||||
<%= f.submit "Join", class: "btn btn-primary px-7 main-large" %>
|
<%= f.submit "Join", class: "btn btn-primary px-7 main-large" %>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<p class="subtitle"><%= subtitle %></p>
|
<p class="subtitle"><%= subtitle %></p>
|
||||||
</div>
|
</div>
|
||||||
<% if search %>
|
<% if search %>
|
||||||
|
<!--
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
<div class="input-icon">
|
<div class="input-icon">
|
||||||
<span class="input-icon-addon">
|
<span class="input-icon-addon">
|
||||||
|
@ -11,6 +12,7 @@
|
||||||
<input type="text" class="form-control btn-pill" placeholder="Search...">
|
<input type="text" class="form-control btn-pill" placeholder="Search...">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
-->
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<hr class="mt-0">
|
<hr class="mt-0">
|
||||||
|
|
|
@ -12,6 +12,8 @@ module Greenlight20
|
||||||
# Application configuration should go into files in config/initializers
|
# Application configuration should go into files in config/initializers
|
||||||
# -- all .rb files in that directory are automatically loaded.
|
# -- all .rb files in that directory are automatically loaded.
|
||||||
|
|
||||||
|
config.exceptions_app = self.routes
|
||||||
|
|
||||||
config.loadbalanced_configuration = (ENV["USE_LOADBALANCED_CONFIGURATION"] == "true")
|
config.loadbalanced_configuration = (ENV["USE_LOADBALANCED_CONFIGURATION"] == "true")
|
||||||
|
|
||||||
# Setup BigBlueButton configuration.
|
# Setup BigBlueButton configuration.
|
||||||
|
|
|
@ -9,8 +9,8 @@ Rails.application.configure do
|
||||||
# Do not eager load code on boot.
|
# Do not eager load code on boot.
|
||||||
config.eager_load = false
|
config.eager_load = false
|
||||||
|
|
||||||
# Show full error reports.
|
# Show custom error pages in development.
|
||||||
config.consider_all_requests_local = true
|
config.consider_all_requests_local = false
|
||||||
|
|
||||||
# Enable/disable caching. By default caching is disabled.
|
# Enable/disable caching. By default caching is disabled.
|
||||||
if Rails.root.join('tmp/caching-dev.txt').exist?
|
if Rails.root.join('tmp/caching-dev.txt').exist?
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
|
|
||||||
|
# Error routes.
|
||||||
|
match '/404', to: 'errors#not_found', via: :all
|
||||||
|
match '/422', to: 'errors#unprocessable', via: :all
|
||||||
|
match '/500', to: 'errors#internal_error', via: :all
|
||||||
|
|
||||||
# Room resources.
|
# Room resources.
|
||||||
resources :rooms, only: [:create, :show, :destroy], param: :room_uid, path: '/r'
|
resources :rooms, only: [:create, :show, :destroy], param: :room_uid, path: '/r'
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ class CreateRooms < ActiveRecord::Migration[5.0]
|
||||||
t.string :name, index: true
|
t.string :name, index: true
|
||||||
t.string :uid, index: true
|
t.string :uid, index: true
|
||||||
t.string :bbb_id, index: true
|
t.string :bbb_id, index: true
|
||||||
t.string :icon, index: true
|
|
||||||
t.integer :sessions, index: true, default: 0
|
t.integer :sessions, index: true, default: 0
|
||||||
t.datetime :last_session, index: true
|
t.datetime :last_session, index: true
|
||||||
|
|
||||||
|
|
|
@ -17,13 +17,11 @@ ActiveRecord::Schema.define(version: 20180504131705) do
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.string "uid"
|
t.string "uid"
|
||||||
t.string "bbb_id"
|
t.string "bbb_id"
|
||||||
t.string "icon"
|
|
||||||
t.integer "sessions", default: 0
|
t.integer "sessions", default: 0
|
||||||
t.datetime "last_session"
|
t.datetime "last_session"
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
t.index ["bbb_id"], name: "index_rooms_on_bbb_id"
|
t.index ["bbb_id"], name: "index_rooms_on_bbb_id"
|
||||||
t.index ["icon"], name: "index_rooms_on_icon"
|
|
||||||
t.index ["last_session"], name: "index_rooms_on_last_session"
|
t.index ["last_session"], name: "index_rooms_on_last_session"
|
||||||
t.index ["name"], name: "index_rooms_on_name"
|
t.index ["name"], name: "index_rooms_on_name"
|
||||||
t.index ["sessions"], name: "index_rooms_on_sessions"
|
t.index ["sessions"], name: "index_rooms_on_sessions"
|
||||||
|
|
|
@ -1,67 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>The page you were looking for doesn't exist (404)</title>
|
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
||||||
<style>
|
|
||||||
.rails-default-error-page {
|
|
||||||
background-color: #EFEFEF;
|
|
||||||
color: #2E2F30;
|
|
||||||
text-align: center;
|
|
||||||
font-family: arial, sans-serif;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rails-default-error-page div.dialog {
|
|
||||||
width: 95%;
|
|
||||||
max-width: 33em;
|
|
||||||
margin: 4em auto 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rails-default-error-page div.dialog > div {
|
|
||||||
border: 1px solid #CCC;
|
|
||||||
border-right-color: #999;
|
|
||||||
border-left-color: #999;
|
|
||||||
border-bottom-color: #BBB;
|
|
||||||
border-top: #B00100 solid 4px;
|
|
||||||
border-top-left-radius: 9px;
|
|
||||||
border-top-right-radius: 9px;
|
|
||||||
background-color: white;
|
|
||||||
padding: 7px 12% 0;
|
|
||||||
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
||||||
}
|
|
||||||
|
|
||||||
.rails-default-error-page h1 {
|
|
||||||
font-size: 100%;
|
|
||||||
color: #730E15;
|
|
||||||
line-height: 1.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rails-default-error-page div.dialog > p {
|
|
||||||
margin: 0 0 1em;
|
|
||||||
padding: 1em;
|
|
||||||
background-color: #F7F7F7;
|
|
||||||
border: 1px solid #CCC;
|
|
||||||
border-right-color: #999;
|
|
||||||
border-left-color: #999;
|
|
||||||
border-bottom-color: #999;
|
|
||||||
border-bottom-left-radius: 4px;
|
|
||||||
border-bottom-right-radius: 4px;
|
|
||||||
border-top-color: #DADADA;
|
|
||||||
color: #666;
|
|
||||||
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="rails-default-error-page">
|
|
||||||
<!-- This file lives in public/404.html -->
|
|
||||||
<div class="dialog">
|
|
||||||
<div>
|
|
||||||
<h1>The page you were looking for doesn't exist.</h1>
|
|
||||||
<p>You may have mistyped the address or the page may have moved.</p>
|
|
||||||
</div>
|
|
||||||
<p>If you are the application owner check the logs for more information.</p>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,67 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>The change you wanted was rejected (422)</title>
|
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
||||||
<style>
|
|
||||||
.rails-default-error-page {
|
|
||||||
background-color: #EFEFEF;
|
|
||||||
color: #2E2F30;
|
|
||||||
text-align: center;
|
|
||||||
font-family: arial, sans-serif;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rails-default-error-page div.dialog {
|
|
||||||
width: 95%;
|
|
||||||
max-width: 33em;
|
|
||||||
margin: 4em auto 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rails-default-error-page div.dialog > div {
|
|
||||||
border: 1px solid #CCC;
|
|
||||||
border-right-color: #999;
|
|
||||||
border-left-color: #999;
|
|
||||||
border-bottom-color: #BBB;
|
|
||||||
border-top: #B00100 solid 4px;
|
|
||||||
border-top-left-radius: 9px;
|
|
||||||
border-top-right-radius: 9px;
|
|
||||||
background-color: white;
|
|
||||||
padding: 7px 12% 0;
|
|
||||||
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
||||||
}
|
|
||||||
|
|
||||||
.rails-default-error-page h1 {
|
|
||||||
font-size: 100%;
|
|
||||||
color: #730E15;
|
|
||||||
line-height: 1.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rails-default-error-page div.dialog > p {
|
|
||||||
margin: 0 0 1em;
|
|
||||||
padding: 1em;
|
|
||||||
background-color: #F7F7F7;
|
|
||||||
border: 1px solid #CCC;
|
|
||||||
border-right-color: #999;
|
|
||||||
border-left-color: #999;
|
|
||||||
border-bottom-color: #999;
|
|
||||||
border-bottom-left-radius: 4px;
|
|
||||||
border-bottom-right-radius: 4px;
|
|
||||||
border-top-color: #DADADA;
|
|
||||||
color: #666;
|
|
||||||
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="rails-default-error-page">
|
|
||||||
<!-- This file lives in public/422.html -->
|
|
||||||
<div class="dialog">
|
|
||||||
<div>
|
|
||||||
<h1>The change you wanted was rejected.</h1>
|
|
||||||
<p>Maybe you tried to change something you didn't have access to.</p>
|
|
||||||
</div>
|
|
||||||
<p>If you are the application owner check the logs for more information.</p>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,66 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>We're sorry, but something went wrong (500)</title>
|
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
||||||
<style>
|
|
||||||
.rails-default-error-page {
|
|
||||||
background-color: #EFEFEF;
|
|
||||||
color: #2E2F30;
|
|
||||||
text-align: center;
|
|
||||||
font-family: arial, sans-serif;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rails-default-error-page div.dialog {
|
|
||||||
width: 95%;
|
|
||||||
max-width: 33em;
|
|
||||||
margin: 4em auto 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rails-default-error-page div.dialog > div {
|
|
||||||
border: 1px solid #CCC;
|
|
||||||
border-right-color: #999;
|
|
||||||
border-left-color: #999;
|
|
||||||
border-bottom-color: #BBB;
|
|
||||||
border-top: #B00100 solid 4px;
|
|
||||||
border-top-left-radius: 9px;
|
|
||||||
border-top-right-radius: 9px;
|
|
||||||
background-color: white;
|
|
||||||
padding: 7px 12% 0;
|
|
||||||
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
||||||
}
|
|
||||||
|
|
||||||
.rails-default-error-page h1 {
|
|
||||||
font-size: 100%;
|
|
||||||
color: #730E15;
|
|
||||||
line-height: 1.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rails-default-error-page div.dialog > p {
|
|
||||||
margin: 0 0 1em;
|
|
||||||
padding: 1em;
|
|
||||||
background-color: #F7F7F7;
|
|
||||||
border: 1px solid #CCC;
|
|
||||||
border-right-color: #999;
|
|
||||||
border-left-color: #999;
|
|
||||||
border-bottom-color: #999;
|
|
||||||
border-bottom-left-radius: 4px;
|
|
||||||
border-bottom-right-radius: 4px;
|
|
||||||
border-top-color: #DADADA;
|
|
||||||
color: #666;
|
|
||||||
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="rails-default-error-page">
|
|
||||||
<!-- This file lives in public/500.html -->
|
|
||||||
<div class="dialog">
|
|
||||||
<div>
|
|
||||||
<h1>We're sorry, but something went wrong.</h1>
|
|
||||||
</div>
|
|
||||||
<p>If you are the application owner check the logs for more information.</p>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe ErrorsController, type: :controller do
|
||||||
|
|
||||||
|
end
|
|
@ -0,0 +1,15 @@
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
# Specs in this file have access to a helper object that includes
|
||||||
|
# the ErrorsHelper. For example:
|
||||||
|
#
|
||||||
|
# describe ErrorsHelper do
|
||||||
|
# describe "string concat" do
|
||||||
|
# it "concats two strings with spaces" do
|
||||||
|
# expect(helper.concat_strings("this","that")).to eq("this that")
|
||||||
|
# end
|
||||||
|
# end
|
||||||
|
# end
|
||||||
|
RSpec.describe ErrorsHelper, type: :helper do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
Loading…
Reference in New Issue