Created
October 7, 2013 07:54
-
-
Save RudolfHattenkofer/6864032 to your computer and use it in GitHub Desktop.
Resourceable usage
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 Category | |
# GET /categories/new | |
def new | |
@category = Category.new | |
end | |
# GET /categories/1/edit | |
def edit | |
end | |
# POST /categories | |
# POST /categories.json | |
def create | |
@category = Category.new( category_params ) | |
respond_to do |format| | |
create_response( @category.save, @category, format, 'Category', admin_category_path(@category) ) | |
end | |
end | |
# PATCH/PUT /categories/1 | |
# PATCH/PUT /categories/1.json | |
def update | |
respond_to do |format| | |
update_response( @category, format, category_params, 'Category', admin_category_path(@category) ) | |
end | |
end | |
# DELETE /categories/1 | |
# DELETE /categories/1.json | |
def destroy | |
@category.destroy | |
respond_to do |format| | |
destroy_response( admin_categories_path, format ) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment