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
rails_admin and app getting signals crossed between routes tables #658
Comments
I have a feeling that this is a 'mountable' engine, rather that a full engine, and so it is not getting the parent routes I can get around the issue by doing an explicit redirect to the full url, as a string, but Im not sure that should be the right way to do it
I will try and look at the code later to see if I am missing something..... |
My brain is obviously not working today.... Not sure if this will work with cancan, I don't use it on this project, but there is a 'main_app' helper, so my post above can actually just be reduced to
|
Hey msimkins, that main_app.root_url bit is exactly what I was looking for to get me around the problem (I kept trying app.root_url, but obviously to no avail). And although it's good to have a workaround, that still leaves me at a bit of a loss as to why this only seems to be affecting my installation. As far as I can tell I've followed most of the standard installation and setup instructions for each of these apps, and I'm not using any particularly edge versions of rails or ruby, so I'd expect that I'd see mostly the same results as other people. |
I certainly see it in 3.1.0.rc5, it is the first time I have used it, so I cannot be sure, but a quick look over the code looks to totally segregate the code from the enclosing app, which is why the 'main_app.root_url' works, I am not sure if this is meant to be the desired behaviour or not, as I am fairly new to the 'Engine' system |
It's normal behaviour. Block is eval'd in ENgine's scope, and routes are now name_scoped. Thanks. |
I haven't quite hammered out if this is a rails_admin issue or simply the way rails_admin is interacting with devise, cancan and/or Rails 3.1, but I'm getting the following exception:
I've been able to reproduce the error within a minute or two by rebuilding an app from scratch as follows:
Run:
Add to ./Gemfile
Run:
Delete from ./config/environments/development.rb
Run:
Add to ./config/routes.rb
Run:
Add to ./app/controllers/application_controllerr.rb
Add to ./config/initializers/rails_admin.rb
Run:
Now go to http://localhost:3000/users/sign_up and create a new user account (not as an admin) and then go to http://localhost:3000/admin - boom, exception. Troubleshooting so far has led me to believe that the redirect_to only has access to the RailsAdmin routes table instead of the app routes table. Since no one else has filed a bug on this I guess it has something to do with the way I've set my app up, although to my knowledge I've follow the rails_admin setup instructions to the letter.
The text was updated successfully, but these errors were encountered: