We have a namespaced model used in a namespaced controller, and an admin namespace inside that.
namespace: foos do
namespace: admin do
resources: bar, only: [:index, :show]
class Bar < ActiveRecord::Base
form_for @bar do
This form will not render the correct path; which makes sense.
- That emits
foos_bars_path, not a thing
- The route is actually
- But if we do
form_for [:admin, @bar] it emits
How can we get the path as we have it currently in routes? We are resorting to a
url: some_helper_method_to_check_new_record but would prefer a cleaner way. Thanks.
This is for Rails 4.2