class Object
Public Instance Methods
Source
# File lib/active_admin/orm/active_record/comments.rb, line 65 def create create! do |success, failure| success.html do redirect_back fallback_location: active_admin_root end failure.html do flash[:error] = I18n.t "active_admin.comments.errors.empty_text" redirect_back fallback_location: active_admin_root end end end
Redirect to the resource show page after comment creation
Source
# File lib/active_admin/orm/active_record/comments.rb, line 77 def destroy destroy! do |success, failure| success.html do redirect_back fallback_location: active_admin_root end failure.html do redirect_back fallback_location: active_admin_root end end end
Source
# File lib/active_admin/orm/active_record/comments.rb, line 60 def scoped_collection super.includes(:author, :resource) end
Prevent N+1 queries
Calls superclass method