Closed ck2000 closed 2 years ago
Have you mounted Alchemy into your app?
# config/routes.rb
Rails.application.routes.draw do
...
mount Alchemy::Engine => "/"
end
Sure, I have tried several mount points. Right now, I am having for testing perposes here:
namespace :admin do ... ... mount Alchemy::Engine => '/cms' end
Do you need further information to reproduce this issue?
I think the namespace could be an issue.
Try to mount the engine in the top level route definition.
Steps to reproduce
Install the lastest version of alchemy and rails. Sign in using your app build in devise authentication.
Expected behavior
After signing in the admin dashboard should load.
Actual behavior
ActionView::Template::Error (undefined local variable or method `alchemy' for #<#:0x00007f8983386ad0>):
1: <%= content_for :toolbar do %>
2: <%= toolbar_button(
3: icon: 'angle-double-left',
4: url: request.referer || alchemy.admin_dashboard_path,
5: label: Alchemy.t(:back),
6: title: Alchemy.t(:back),
7: hotkey: 'alt+z',
System configuration
initializers/alchemy.rb Alchemy.user_class_name = 'Admin' # Defaults to 'User' Alchemy.current_user_method = 'current_admin' # Defaults to 'current_user' Alchemy.login_path = '/admin/sign_in' # Defaults to '/login' Alchemy.logout_path = '/admin/sign_out' # Defaults to '/logout' Alchemy.logout_method = 'delete' # Defaults to 'delete'