Reputation: 6660
I made a member action like this :
member_action :send_by_email, :method => :get
Its supposes to execute Admin::CardsController/send_by_email but it's not, i don't launch the controller action.
My file is cards_controller.rb in app/controllers/admin
class Admin::CardsController < ApplicationController
def send_by_email
raise "ok"
end
end
When i do rake routes, i got :
send_by_email_admin_card GET /admin/cards/:id/send_by_email(.:format) admin/cards#send_by_email
Any idea?
Upvotes: 1
Views: 1670
Reputation: 1337
You're overriding your work.
If you define an action in Admin::CardsController you're doing the same as defining it with member_action.
The recommended way is to define Admin Resource Controller actions with member_action instead of digging in their controller.
Upvotes: 1
Reputation: 9577
To debug further, try this:
member_action :send_by_email do
raise "ok" #assuming that works, I use puts statements but whatev.
end
I found that I had to put all my 'stuff' in the block within the app/admin/cards.rb
Upvotes: 0