Method: CategoriesController#update
- Defined in:
- app/controllers/categories_controller.rb
#update ⇒ Object
PUT /categories/1 PUT /categories/1.json
52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'app/controllers/categories_controller.rb', line 52 def update @category = Category.find(params[:id]) respond_to do |format| if @category.update_attributes(params[:category]) format.html { redirect_to @category, notice: 'Category was successfully updated.' } format.json { head :ok } else format.html { render action: "edit" } format.json { render json: @category.errors, status: :unprocessable_entity } end end end |