-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined method `refinery_user?' when use with ActiveAdmin #1804
Comments
Hello, Thanks for this. To work around the issue you can override the site bar file using <% if refinery_user_signed_in? && current_refinery_user.has_role?(:refinery) && "#{controller_name}##{action_name}" != 'pages#preview' %> |
Ah! Alternatively place this in your include Refinery::AuthenticatedSystem |
Here's my ApplicationController (well, actually yours as I cloned your project) which works: class ApplicationController < ActionController::Base
protect_from_forgery
include Refinery::AuthenticatedSystem
end |
I'm not entirely sure why but from what I can gather (being that you can put |
thanks for being lightning fast at responding again and with effective workarounds! using |
Yeah |
np it was understood. by the way this is a better link to the potential culprit method in ActiveAdmin in case it's obvious to some eyes something is missing in there (such as dealing with other mounted engines?). I tried moving the (priority) order of |
I wonder if @gregbell has any insight into this that he could share? :-) |
hope @pcreux doesn't mind being mentioned here as well :) |
Hi Guys, I had a brief chance to look into this today. It's not entirely clear what the source of the bug is, but it seems to be related to the use of Devise in both projects. I'm swamped today, but I hope to get a chance to take a look at it over the next couple of days. I'll report back on what I find. |
thanks for looking into it. in case it helps, i do have other devise routes defined in my routes file, such as ( |
Hi, me too facing the same issue when i tried integrating both refinery and activeadmin together into an app, while individually both ran fine. Is there anything to guide me par this issue or cuztomization i need to do to make this two gems work together? Hoping a timely reply, thanks. |
The workaround solution is contained further up - aka in your ApplicationController class put: helper_method :refinery_user? |
This happens for me when integrating Refinery with Spree 1.2 as well. I've implemented the fix above in my example app (https://github.com/adrianmacneil/refinery_spree), no idea what is causing it though. |
Seeing as we have a fix, and this depends on active_admin being present, I'm going to mark this as closed. Give me your objections and I will happily consider them. |
Basically if you include 'activeadmin' gem, when rendering the view containing a
refinery_user?
call, the method is recognized. This is probably due to the incompatibility between ActiveAdmin's fancyActiveAdmin.routes(self)
inroutes.rb
(https://github.com/gregbell/active_admin/blob/master/lib/active_admin/application.rb#L199) vsmount Refinery::Core::Engine, :at => '/'
Steps:
Error
The above example app is here https://github.com/harleyttd/rickrockstar
I just realized I should have reproduced with the edge version. Hope it still helps given it's the latest release and I didn't find any past issue mentioning this.
Thanks
The text was updated successfully, but these errors were encountered: