Created
January 30, 2015 03:12
-
-
Save AndrewRayCode/af11c5e4290eb16e4d37 to your computer and use it in GitHub Desktop.
This file contains 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 ModelsController < ApplicationController | |
before_action :set_model, only: [:show, :edit, :update, :destroy] | |
respond_to :html, :json | |
def update | |
Rails.logger.info "==============" | |
Rails.logger.info params[:model][:tags] | |
Rails.logger.info params[:model][:tag_list] | |
Rails.logger.info "==============" | |
@model.update(model_params) | |
respond_with(@model) | |
end | |
def destroy | |
@model.destroy | |
respond_with(@model) | |
end | |
private | |
def model_params | |
params.require(:model).permit( | |
:name :image_data, :tag_list, :tags | |
) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment