You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like an awesome CMS! Having some trouble getting it running though:
undefined local variable or method `current_user' for #<Tenon::IndexController:0x0000000256e468>
Extracted source (around line #41):
def require_admin
unless current_user && current_user.staff?
flash[:warning] = "You're not authorized for that." if current_user
redirect_to new_user_session_path
end
running rails 5 with ruby-head
got tenon installed by adding the following gems to the Gemfile
em 'tenon'
gem 'devise'
gem 'client_side_validations'
gem 'activemodel-serializers-xml', git: 'https://github.com/rails/activemodel-serializers-xml'
gem 'draper', github: 'audionerd/draper', branch: 'rails5'
I'm also getting warnings about using deprecated methods
DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can
access the original method using super. (called from <top (required)> at
/home/webdev/repos/test/tenon/config/application.rb:6)
Sounds like a devise issue, any ideas?
I do know that running rake db:migrate didn't throw any devise errors.
The text was updated successfully, but these errors were encountered:
skinnyjames
changed the title
undefined local variable or method `current_user' for #<Tenon::IndexController:0x0000000256e468>
undefined local variable or method `current_user' for #<Tenon::IndexController...
Jun 28, 2016
Is Devise all set up? The documentation for linking Tenon up with an auth gem is pretty poor, so I apologize for that, but essentially your ApplicationController needs to have a current_user method available (eg. the one provided by Devise) and your User model (or whatever is returned by current_user) needs to respond to #staff?, #admin?, #super_admin?, and #contributor?
You can override Tenon::ApplicationPolicy if you don't want to worry supporting those last 3 roles, those are just roles we use in most of our applications.
Documentation for this whole thing is pretty sparse, feel free to open more issues if you get stuck.
Looks like an awesome CMS! Having some trouble getting it running though:
running rails 5 with ruby-head
got tenon installed by adding the following gems to the Gemfile
em 'tenon'
gem 'devise'
gem 'client_side_validations'
gem 'activemodel-serializers-xml', git: 'https://github.com/rails/activemodel-serializers-xml'
gem 'draper', github: 'audionerd/draper', branch: 'rails5'
I'm also getting warnings about using deprecated methods
Sounds like a devise issue, any ideas?
I do know that running rake db:migrate didn't throw any devise errors.
The text was updated successfully, but these errors were encountered: