mirror of
https://github.com/oonyeje/Pearlception_Website_RoR.git
synced 2025-12-25 03:37:40 +00:00
Fixed routes
This commit is contained in:
parent
87d4a4185f
commit
58259d5a83
@ -1,5 +1,5 @@
|
||||
class ApplicationController < ActionController::Base
|
||||
protect_from_forgery with: :exception
|
||||
#protect_from_forgery with: :exception
|
||||
protected
|
||||
|
||||
def authenticate_user
|
||||
|
||||
@ -6,7 +6,6 @@ class SessionsController < Devise::RegistrationsController
|
||||
end
|
||||
|
||||
def create
|
||||
puts "NOW IN CREATE"
|
||||
params = sign_in_params
|
||||
@user = User.find_by(email: params[:email])
|
||||
if @user == nil || !@user.valid_password?(params[:password])
|
||||
@ -19,7 +18,7 @@ class SessionsController < Devise::RegistrationsController
|
||||
if !current_user.admin
|
||||
Apartment::Tenant.switch!(Company.find(current_user.company_id).company_name.gsub(/'/,'').gsub(/\s/,''))
|
||||
end
|
||||
redirect_to "/"
|
||||
redirect_to "/pearlception"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@ -1,12 +1,4 @@
|
||||
class Oyster < ApplicationRecord
|
||||
belongs_to :run
|
||||
#Oyster.establish_connection(:"stats_#{Rails.env}")
|
||||
#Oyster.establish_connection(
|
||||
#:adapter => "mysql2",
|
||||
#:host => ENV['STATS_DB_URL'],
|
||||
#:username => ENV['STATS_DB_USER'],
|
||||
#:password => ENV['STATS_DB_PASS'],
|
||||
#:database => "main"
|
||||
#)
|
||||
scope :run_id, -> (id) { where run_id: id.to_i }
|
||||
end
|
||||
|
||||
@ -1,12 +1,3 @@
|
||||
class Run < ApplicationRecord
|
||||
has_many :oysters
|
||||
#belongs_to :companies
|
||||
# establish_connection(:"stats_#{Rails.env}")
|
||||
#Run.establish_connection(
|
||||
#:adapter => "mysql2",
|
||||
#:host => ENV['STATS_DB_URL'],
|
||||
#:username => ENV['STATS_DB_USER'],
|
||||
#:password => ENV['STATS_DB_PASS'],
|
||||
#:database => "main"
|
||||
#)
|
||||
end
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
require 'subdomain'
|
||||
|
||||
Rails.application.routes.draw do
|
||||
constraints(Subdomain) do
|
||||
root 'dashboard#index'
|
||||
get '/pearlception', to: "dashboard#index"
|
||||
# More subdomain constrained routes...
|
||||
get 'oysters/show'
|
||||
get 'oysters/index'
|
||||
@ -20,7 +19,6 @@ Rails.application.routes.draw do
|
||||
get 'signin' => 'sessions#new'
|
||||
post 'signin' => 'sessions#create'
|
||||
end
|
||||
end
|
||||
|
||||
#binding.pry
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user