New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't register Comment model #2493
Comments
The ActiveAdmin.register ActiveAdmin::Comment, as: 'Comment' do
# ...
end To better understand how it all works, check out the source code. |
Namespace, exactly. Thanks! |
No problem |
It's strange, but could you explain me why the code in controller part has no effect please? ActiveAdmin.register ActiveAdmin::Comment do
menu false
controller do
def create
# Try to raise exception
creat2e!
@comment.r
end
end
end |
You need to specify the |
Like this? ActiveAdmin.register ActiveAdmin::Comment, as: 'Comment' do
menu false
controller do
def create
# Try to raise exception
creat2e!
@comment.r
end
end
end Done, but nothing changed. |
Ah... the problem is we're using the after_load hook, which is run after your app/admin config files are loaded. So in order to override the behavior you have to use the ActiveAdmin.after_load do
ActiveAdmin.register ActiveAdmin::Comment, as: 'Comment' do
controller do
def create
raise 'ooooooo'
end
end
end
end |
Works like a charm. Thanks again ;) |
The goal is to overwrite some actions of comments_controller. So, I trying this:
and getting uninitialized constant Comment. What the problem is? ActiveAdmin version is 0.6.0
The text was updated successfully, but these errors were encountered: