Created
March 11, 2014 02:56
-
-
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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