Sha256: d0fa9f84b71e7b2a97a8a8e6c6c247c05beb5f81e7bda48db596320dfa6c7833

Contents?: true

Size: 908 Bytes

Versions: 4

Compression:

Stored size: 908 Bytes

Contents

class Admin::ViewsController < AdminController
  layout 'cms-boxed'

  def index
    @views = View.sys(_sid).all
  end

  def show
    @view = View.find_sys_id(_sid, params[:id])
  end

  def new
    @view = View.new
  end

  def create
    add_sid(:view)
    @view = View.new(params[:view])
    if @view.save
      redirect_to [:admin, @view], :notice => "Successfully created view."
    else
      render :action => 'new'
    end
  end

  def edit
    @view = View.find_sys_id(_sid, params[:id])
  end

  def update
    @view = View.find_sys_id(_sid, params[:id])
    if @view.update_attributes(params[:view])
      redirect_to [:admin, @view], :notice  => "Successfully updated view."
    else
      render :action => 'edit'
    end
  end

  def destroy
    @view = View.find_sys_id(_sid, params[:id])
    @view.destroy
    redirect_to admin_views_url, :notice => "Successfully destroyed view."
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
kit_cms-2.3.9 app/controllers/admin/views_controller.rb
kit_cms-2.3.8 app/controllers/admin/views_controller.rb
kit_cms-2.3.7 app/controllers/admin/views_controller.rb
kit_cms-2.3.6 app/controllers/admin/views_controller.rb