Steven Fried

Joined

60 Experience
0 Lessons Completed
0 Questions Solved

Activity

I'm having the same problem as this user. Based on the logs, I think you're right, the account is not being set. Here is the code from the application_controller.

class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
#before_action :authenticate_user!
before_action :configure_permitted_parameters, if: :devise_controller?
before_action :set_account

def require_account!
  redirect_to root_url(subdomain: 'www') if [email protected]?
end

def set_account
  @account = Account.find_by(subdomain: request.subdomain)
end

def configure_permitted_parameters
  devise_parameter_sanitizer.permit(:sign_up, keys: [:tos,
   account_attributes: [:subdomain]]) 
end

end

How else would I set the account?

Thanks in advance.

Posted in Apartment and Heroku

I am trying to implement Apartment. It works fine in development but the app won't load on production. I get this error:

Apartment::TenantNotFound (One of the following schema(s) is invalid: "ocapp" "public"):

I have researched and tweaked but can't seem to find out what's missing. Any help would be most appreciated.

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2020 GoRails, LLC. All rights reserved.