Sha256: 75a405015fc968c7a3a3943d047fb0da18268b927726082266ef108eaacb415e
Contents?: true
Size: 1.05 KB
Versions: 1
Compression:
Stored size: 1.05 KB
Contents
class PagesController < ApplicationController before_filter :authenticate, :except => 'show' before_filter :authenticate_with_admin, :except => 'show' def index @pages = Page.by_recent render layout: 'admin' end def show @page = Page.find(params[:id]) end def new @page = Page.new render layout: 'admin' end def edit @page = Page.find(params[:id]) render layout: 'admin' end def create @page = Page.new(params[:page]) if @page.save redirect_to @page, notice: t('pages.create.notice') else render action: "new", warning: t('pages.create.warning'), layout: 'admin' end end def update @page = Page.find(params[:id]) if @page.update_attributes(params[:page]) redirect_to @page, notice: t('pages.update.notice') else render action: "edit", warning: t('pages.update.warning'), layout: 'admin' end end def destroy @page = Page.find(params[:id]) @page.destroy redirect_to pages_url, notice: t('pages.destroy.notice') end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
tkh_content-0.0.1 | app/controllers/pages_controller.rb |