Skip to content

Instantly share code, notes, and snippets.

@traviskroberts
Created March 11, 2014 02:56
Show Gist options
  • Save traviskroberts/9478684 to your computer and use it in GitHub Desktop.
Save traviskroberts/9478684 to your computer and use it in GitHub Desktop.
Code for blog post "ActiveAdmin: Redirect to Index on Create/Update" - http://nomethoderror.com/blog/2014/03/10/activeadmin-redirect-to-index-on-create-update/
ActiveAdmin.register User do
# ...truncated code...
controller do
def create
super do |format|
redirect_to collection_url and return if resource.valid?
end
end
def update
super do |format|
redirect_to collection_url and return if resource.valid?
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment