the_sortable_tree
the_sortable_tree copied to clipboard
Fix namespacing issues for links in render helpers
- d3c0e0d8 removed the ability to use namespaces on the sortable tree helper. This reinstates that capability, but also adds consistent rendering and namespacing for all render helpers.
- ce696f3a meant to clarify that a
show
link was not being used for adelete
link, but neglected to update in all the helpers. This PR also addresses that issue. - Actually, this PR makes each renderer consistent in how it builds links, and allows you to explicitly pass what controller you want to use for building said links.
looks fine - I will try it on my dummy app - if it's works correct - I will be glad to merge it
thank you!
Just so you know, I may have one or two more adjustments coming through on separate PRs today. I'm trying to get this working with ActiveAdmin, and there are a few issues I'm working through...
Actually, I lied. I'm including that as part of this PR. Instead of trying to infer the link controller from the klass
option, we first check to see if the user passed a controller
option, and we use that instead.
So I'm not sure exactly how this is working, but namespace is never actually used. I have namespaced routes (under /admin
using ActiveAdmin), and after removing the namespace
option from my tree renderer call, it still works fine. However, my controller is named (without a namespace) to make it work properly, since my class name does not match my controller name.
It turns out that adding the namespace
options just added the value to the URL query string, which was not what the end goal was.
It was good PR. I have to keep it in mind if I will improve the gem. Thanks again!