Class: Infold::ModelsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Infold::ModelsController
- Defined in:
- app/controllers/infold/models_controller.rb
Instance Method Summary collapse
Instance Method Details
#edit ⇒ Object
3 4 5 |
# File 'app/controllers/infold/models_controller.rb', line 3 def edit @model = Model.find(params[:id]) end |
#update ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/infold/models_controller.rb', line 7 def update @model = Model.find(params[:id]) @model.assign_attributes(post_params) if @model.save flash.now[:info] = t('infold.flash.updated') else Rails.logger.debug "エラー #{@model.errors.}" flash.now[:warning] = t('infold.flash.invalid') render status: :unprocessable_entity end end |