Class: Cmsable::CmsableController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/cmsable/cmsable_controller.rb

Instance Method Summary collapse

Instance Method Details

#updateObject



3
4
5
6
7
8
9
10
11
# File 'app/controllers/cmsable/cmsable_controller.rb', line 3

def update
  model = params[:model].constantize

  record = model.find(params[:id])
  body = params.require(:content).permit(:body)[:body]
  attribute = model.cmsable_body

  render text: record.update(attribute => body)
end