Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActiveAdmin throws error when posting comment to a nested resource

Using the awesome ActiveAdmin gem I've run into an issue 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 to a sale with the above setup, the comment posts, but then crashes on the redirect 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 does not seem to be able to figure that out, and I'm not sure where to patch this up.

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

like image 709
Alex Wayne Avatar asked Oct 22 '13 22:10

Alex Wayne


1 Answers

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

like image 185
Alex Wayne Avatar answered Nov 13 '22 21:11

Alex Wayne