jejacks0n/mercury — Issue #104: mercury_update_*_path doesn't work in namespaced controller
Author: jlsuttles
Created: 2011-12-04 09:13:49+00:00
State: open

Gemfile

gem 'mercury-rails', git: 'https://github.com/jejacks0n/mercury.git', ref: '621071ca24'

config/routes.rb

Mercury::Engine.routes

resources :admin do
resources :image do
member do
post :mercury_update
end
end

app/controllers/admin/images_controller.rb

class Admin::ImagesController
def mercury_update
end
end

app/views/admin/images

<%= link_to "Edit filenames", "/editor" + request.path, id: "edit_link", data: { save_url: mercury_update_admin_image_path(@image) } %>

http://localhost:3000/admin/images

Routing Error
No route matches {:action=>"mercury_update", :controller=>"admin/images"}

rake routes | grep mercury_update_admin_image

mercury_update_admin_image POST /admin/images/:id/mercury_update(.:format) {:action=>"mercury_update", :controller=>"admin/images"}

Also see https://gist.github.com/1391211