I have a resource that's accessible both with and without a namespace.
# routes.rb
resources :foo
namespace :admin do
resources :foo
end
I want to use the same _form partial in both cases, but form_for requires a different argument depending upon the controller.
Should I set the form_for argument in the controllers?
# foo_controller.rb
def set_foo
@form_for_arg = @foo
end
# admin/foo_controller.rb
def set_foo
@form_for_arg = [:admin, @foo]
end