Class: Tandem::ContentsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/tandem/contents_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_user

Instance Method Details

#editObject

GET /contents/1/edit



77
78
# File 'app/controllers/tandem/contents_controller.rb', line 77

def edit
end

#updateObject

PUT /contents/1 PUT /contents/1.json



82
83
84
85
86
87
88
89
90
91
92
# File 'app/controllers/tandem/contents_controller.rb', line 82

def update
  param_key = ActiveModel::Naming.param_key(@content)

  respond_to do |format|
    if @content.update_attributes(params[param_key])
      format.json { render json: @content }
    else
      format.json { render json: @content.errors, status: :unprocessable_entity }
    end
  end
end