Sha256: b5bc32fa072adf4d182190937b0e816419f347f1e0ee8705b7fd62bf8c1bd39b
Contents?: true
Size: 916 Bytes
Versions: 28
Compression:
Stored size: 916 Bytes
Contents
require_dependency "smithy/base_controller" module Smithy class ImagesController < BaseController respond_to :html, :json def show @image = Smithy::Image.find(params[:id]) respond_with @image end def new @image = Smithy::Image.new(filtered_params) respond_with @image end def create @image = Smithy::Image.new(filtered_params) @image.save flash.notice = "Your image was created" if @image.persisted? respond_with @image end def edit @image = Smithy::Image.find(params[:id]) respond_with @image end def update @image = Smithy::Image.find(params[:id]) flash.notice = "Your image was saved" if @image.update_attributes(filtered_params) respond_with @image end def destroy @image = Smithy::Image.find(params[:id]) @image.destroy respond_with @image end end end
Version data entries
28 entries across 28 versions & 1 rubygems