I tried following the advice in this Rails3 Routes - Passing parameter to a member route
I have: _health.html (partial)
<%= link_to image_tag("icons/pro_gray.png", :border =>'none'), flag_contact_flags_path(@id), :action => "flag", :id => @id, :remote => true, :class => 'flag' %>
routes.rb
resources :contact_flags do
get 'flag/:id', :action => 'flag', :on => :collection
end
When I do this I get this error: ActionView::Template::Error (undefined method `flag_contact_flags_path' for #<#:0x00000101430358>):
When I rake routes I show: GET /contact_flags/flag/:id(.:format) {:action=>"flag", :controller=>"contact_flags"}
Why doesn't think work?
I really need to pass the :id parameter.. any ideas?
Thanks