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
Error: No route matches {:action=>"show", :controller=>"users_admin/admin"} #70
Comments
I'm unfortunately not able to replicate this so far. Are you able to create a minimal Rails app that exhibits the issue and upload it to GitHub? |
It might very well be influenced by our User model, but I have no clear understanding of why that would affect the routes at the moment, so it makes troubleshooting this difficult. Minimal rails app is not showing this with a basic User. |
Can you post the output of (shell command):
and from rails console:
|
|
|
@spohlenz Any thoughts? |
I'm still puzzled by this. It seems like there must be something defined within your |
@spohlenz Yeah, it's strange. So I spent time commented out code in I also commented out routes that could maybe conflict, such as devise and our My team is asking me to roll back away from Trestle, but of course, I want to stay with it. Any other thoughts off hand? |
I also tried renaming to |
This might be related to the ID column. What happens if the following is added to the controller do
def show
super
self.instance.instance_eval do
def id
"test"
end
end
end
end |
@svoboda-jan Thanks for the thought. That didn't change the error unfortunately. |
@kevinelliott In the "minimal Rails app", do you handle IDs on models the same way as in the real app? (UUID) |
I've ditched the minimal Rails app now, so I can't be sure there. But I did enable UUID. |
The thing is, I'm using UUID on all of our other resources, and there's no issue with the Show page for them. Only |
@kevinelliott Ok, so then maybe it is not because of (UU)IDs. Do you use something like the There are more tests you can do to rule out few things, for example, rename the model (class) to class MyTestUser < ActiveRecord::Base
self.table_name = "users"
end |
@svoboda-jan Nope, not overriding And it took some effort, but I renamed
|
I freaking found it. |
In trying to build up the form, it's evaluating a relationship I commented out the Thus, the Thus, I'm wonder what we can do to coax Trestle into understanding this issue. |
@kevinelliott Nice to hear that. :) Why isn't it possible to disable devise_invitable? Without UUID it cannot be used anyway. |
@kevinelliott Also where exactly does the error come from, is it the |
@svoboda-jan So, we are actively using devise_invitable, it is used by our admins to invite users to our platform. The only thing broken with it is that the invitations are not properly associated to who invited them, but otherwise it is working as expected. I can not disable that at this time. We do have someone working on changing it to work with UUID though, so eventually that will be ready. But in the meantime, our admin panel is in this semi-broken state, and I've been given a do or die on this. |
It seems like (according to above screenshots) that it's when it's trying to calculate the form. So, I can try to manually define the form. We have a lot of attributes, so it will take me some time to define. Is there anyway to manually define the one field and then specify the rest to be automatically determined? |
@kevinelliott Not sure and don't think such functionality is available right now. There is a workaround you could use, Trestle uses AR columns method, so you could override that in the model: def self.columns
super.reject { |c| c.name == "invited_by_id" }
end |
@svoboda-jan I can't do it in the model, because then that will break our invitations panel. But, is there a way to monkey patch (I haven't said that for so long now) Trestle to do just this when it queries against the columns? |
@kevinelliott Sure, you could use the "new" Trestle::Adapters::ActiveRecordAdapter.prepend(Module.new do
def default_attributes
super.reject { |c| c.name == :invited_by_id }
end
end) |
Really happy to see the source of this has been found. I'll trace it further on my end to see if there's anything Trestle can do to avoid it. Thank you @svoboda-jan for your help. Here's another way to disable specific fields within a resource: adapter do
def default_form_attributes
super.reject { |column| column.name == :invited_by_id }
end
end |
And we have success! Thank you both @svoboda-jan and @spohlenz. I'm really happy that we've been able to squash this, for the interim. |
Okay, so this was definitely an issue within Trestle rather than you doing anything wrong. The error was occurring within the automatic form builder when a polymorphic association was blank. It has now been fixed in 64ddc3f, so you shouldn't need the adapter customization after upgrading. I'll likely have a new gem release sometime this weekend. Thank you for help in tracking it down. |
I have bit different issue when i do ContentsAdmin.path(:new) how do i add a new route to my app through trestle engine. |
For some reason when I look at a show page for a
Users
resource, I get this routing error. This doesn't happen to any of the other managed resources in the Trestle admin panel, and they are all configured the same.Thanks for your great work on this project.
The text was updated successfully, but these errors were encountered: