Created
January 8, 2010 20:38
-
-
Save tammersaleh/272394 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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