-
-
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
refinery cms integrate into existing app, devise routes has problem #2406
Comments
Did you add a route to signup_path? Refinery won’t be providing anything like that because refinerycms-authentication won’t have been added. |
Nope.Should I have to add refinery-authentication module or just routing signup_path to my devise routes? |
Don’t add refinerycms-authentication, just route to your signup_path |
Hi @parndt , could u pls give me some example about how to route refinery engine's |
I try the below in routes.rb
the
I have no idea where the problem is |
Can you use a redirect route instead? Does anything already work? |
I mount it on
|
Do you have a full stack trace from this error:
Including the parts you think may not be relevant. :) |
There is the full trace info :)
|
Hi @parndt ,do you have any suggestion about that? |
You could override |
Hi @parndt , I am confusing about I have override
::Refinery::ApplicationController.module_eval do
def just_installed?
::Role[:refinery].users.empty?
end
def refinery_user_required?
if just_installed? and controller_name != 'users'
redirect_to main_app.new_user_registration_path
end
end
def store_location
session[:return_to] = request.fullpath.sub("//", "/")
end
# Redirect to the URI stored by the most recent store_location call or
# to the passed default.
def redirect_back_or_default(default)
redirect_to(session[:return_to] || default)
session[:return_to] = nil
end
# This just defines the devise method for after sign in to support
# extension namespace isolation...
def after_sign_in_path_for(resource_or_scope)
scope = Devise::Mapping.find_scope!(resource_or_scope)
home_path = "#{scope}_root_path"
respond_to?(home_path, true) ? refinery.send(home_path) : refinery.admin_root_path
end
def after_sign_out_path_for(resource_or_scope)
refinery.root_path
end
def refinery_user?
refinery_user_signed_in? && current_refinery_user.has_role?(:refinery)
end
def refinery_user_signed_in?
user_signed_in?
end
def authenticate_refinery_user!
authenticate_user!
end
def current_refinery_user
current_user
end
protected :store_location, :redirect_back_or_default, :refinery_user?
def self.included(base)
if base.respond_to? :helper_method
base.send :helper_method, :current_refinery_user, :current_user_session,
:refinery_user_signed_in?, :refinery_user?
end
end
end |
Another confusing is in my main app def after_sign_in_path_for(resource_or_scope)
root_path
end so when I override def require_refinery_users!
false
end in |
You're not going to see the dashboard if you redirect to your application's |
Oops, I locate the problem is maybe refinery helper is not working, in dashboard page ,the error message is:
Seems |
@parndt it says |
Ok, I found where the problem truly is, just wrote here for somebody who use the guide from refinerycms-rails-3-2-into-your-existing-app.
|
@sky2127211 How you solved this problem? |
@sky2127211 @sunloverz I apologize for taking so long to update my article for Refinery 2.1. I've updated the article: http://sdownie.com/articles/refinerycms-rails-3-2-into-your-existing-app |
@sunloverz Do not use user.rb file in the guides , override require_refinery_users! in refinery's admin_controller then it works! I saw the guide author updated the article, @sdownie thanks for your updating, I will try it :) |
Hi, refinerycms integration into an app which has contains a devise as user authentication system is done, but I encounter a problem.
I mount the refinery engine in my routes.rb:
mount Refinery::Core::Engine, :at => '/blogs'
My application has header with
new_user_session_path
andnew_user_registration_path
ordestroy_user_session_path
for all the pages, also for the refinery pages. I got anundefined local variable or method "new_user_session_path" for #<#<Class:0x007f9a686c8388>:0x007f9a686d29f0>
error when open refinery pageshttp://localhost:3000/blogs
.After find some discussion in google groups, I follow the suggestion add
main_app
prefix in devise path, it works! I can open the refinery homepage. but a new issue comes out when I openhttp://localhost:3000/blogs/refinery
:I have no idea how to handle this, any suggestion will be appreciated!
PS: I had followed the instruction in with-an-existing-rails-31-devise-app and added
refinery_patch .rb
restrict_refinery_to_refinery_users.rb
intolib/refinery
and then loaded it inapplication.rb
. it says "it will just consist in telling refinery to use your devise helpers" but not working!The text was updated successfully, but these errors were encountered: