class ApplicationController < ActionController::Base # ... helper_method :bucket_options private def bucket_options { publishable_key: Rails.application.credentials.bucket_publishable_key, user: { id: current_user&.id }, company: { id: current_company&.id }, # or current_user.id again if you don't have companies toolbar: Rails.env.development? || current_user&.admin? } end end