ActiveAdmin throws an error when posting a comment to a sub-resource

Using the huge ActiveAdmin gem. I ran into a problem with comments.

ActiveAdmin.register Sale do belongs_to :channel show do |sale| # stuff to show sale resource... # allow comments on sales active_admin_comments end end 

If I post a comment on a sale with the above setting, comment messages, but then fail when redirecting with:

 undefined method `admin_sale_path' for #<Admin::CommentsController:0x007ffed79bb210> 

The correct routing method would be admin_channel_sale_path(sale.channel, sale) , but it seems he can't figure it out, and I'm not sure where to fix it.

Is there a place in my Sale resource where I can override the routing method used to prevent this error?

+8
ruby ruby-on-rails activeadmin
source share
3 answers

Derp ... This was actually fixed when I upgraded to 0.6.0 to 0.6.2. Move along ...: (

+2
source share

make sure you channel handle sale

In routes.rb

 namespace "sale" do namespace "namespace" do resources :channel end end 
0
source share

Is this related to this? https://github.com/gregbell/active_admin/issues/2082

Their request for stretching is open, it has not been combined.

0
source share

All Articles