Skip to content

Instantly share code, notes, and snippets.

@tammersaleh
Created January 8, 2010 20:38
Show Gist options
  • Save tammersaleh/272394 to your computer and use it in GitHub Desktop.
Save tammersaleh/272394 to your computer and use it in GitHub Desktop.
class ClientsController < InheritedResources::Base
actions :index, :create, :update, :destroy
belongs_to :user
def create
create! do |success, failure|
success.html { redirect_to collection_url }
failure.html { collection; render :action => :index }
end
end
def update
update! do |success, failure|
success.html { redirect_to collection_url }
failure.html { collection; render :action => :index }
end
end
def destroy
destroy! do |format|
format.html { redirect_to collection_url }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment