Skip to content

Instantly share code, notes, and snippets.

@AndrewRayCode
Created January 30, 2015 03:12
Show Gist options
  • Save AndrewRayCode/af11c5e4290eb16e4d37 to your computer and use it in GitHub Desktop.
Save AndrewRayCode/af11c5e4290eb16e4d37 to your computer and use it in GitHub Desktop.
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