Sha256: d9e01d3faa7ca9769f4c03c6a961d0475d549503b06e368831c81ac1f939a40b
Contents?: true
Size: 952 Bytes
Versions: 14
Compression:
Stored size: 952 Bytes
Contents
# Handles file uploads for content pictures. require_dependency "lines/admin/application_controller" module Lines class Admin::PicturesController < Admin::ApplicationController def create @picture = Picture.create(picture_params) end # PUT /admin/pictures/1 def update @picture = Picture.find(params[:id]) respond_to do |format| if @picture.update_attributes(picture_params[:picture]) format.html { redirect_to @picture, notice: 'Picture was successfully updated.' } else format.html { render action: "edit" } end end end # Deletes a picture. Only responds to JS requests. def destroy @picture = Picture.find(params[:id]) @picture.destroy respond_to do |format| format.js end end private # strong_params def picture_params params.fetch(:picture, {}).permit(:image) end end end
Version data entries
14 entries across 14 versions & 1 rubygems