Search code examples
ruby-on-railsruby-on-rails-3ruby-on-rails-3.1activeadmin

How to get object id in after_filter during object creation?


The following works for an update:

after_filter :only => [:create, :update] do
    logger.info params[:id]
end

How can I reference the id on create?


Solution

  • You can't. There's no params[:id] because you don't have any record of that id, you only create it.