the_sortable_tree icon indicating copy to clipboard operation
the_sortable_tree copied to clipboard

Fix namespacing issues for links in render helpers

Open shekibobo opened this issue 11 years ago • 6 comments

  • 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 a delete 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.

shekibobo avatar Feb 11 '14 19:02 shekibobo

looks fine - I will try it on my dummy app - if it's works correct - I will be glad to merge it

thank you!

the-teacher avatar Feb 11 '14 19:02 the-teacher

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...

shekibobo avatar Feb 11 '14 20:02 shekibobo

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.

shekibobo avatar Feb 11 '14 20:02 shekibobo

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.

shekibobo avatar Feb 11 '14 20:02 shekibobo

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.

shekibobo avatar Feb 11 '14 20:02 shekibobo

It was good PR. I have to keep it in mind if I will improve the gem. Thanks again!

the-teacher avatar Sep 28 '16 16:09 the-teacher