
form_for fails with namespaced controllers
Reported by Łukasz Piestrzeniewicz | June 22nd, 2009 @ 09:21 AM
I'm trying to migrate Searchlogic 1.6.x app to 2.0.x. We use Searchlogic for both user and admin interface. The latter has a problem due to usage of namespaced controllers:
In routes.rb we have:
map.namespace :administration do |administration|
administration.resources :jobs, :collection => {:areas => :get, :majors => :get}
In administration/jobs/_search partial I want to submit job search to administration/jobs, using standard form_for (haml code):
- form_for([:administration, @search], :id => 'search') do |f|
This fails with:
undefined method administration_searchlogic_search_path'
for #<ActionView::Base:0x42c1484>
(ActionView::TemplateError)
In my opinion it should rather use for administration_jobs_path - as it did in Searchlogic 1.6.x. View helper for form_for lacks tests and does some magic on the parameters so it's hard to pinpoint the problem.
Comments and changes to this ticket
-
Ben Johnson June 24th, 2009 @ 02:05 AM
- State changed from new to resolved
I agree, I think using url_for should do the trick. I'll add that in. Thanks!
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Provides common named scopes and object based searching.