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