Sha256: d67ae977f6218da3b2daf6e21f5171c5285845ed3d5b9d81a7c18530e2a29e7a
Contents?: true
Size: 937 Bytes
Versions: 3
Compression:
Stored size: 937 Bytes
Contents
require_dependency 'quadro/application_controller' module Quadro class PagesController < ApplicationController before_filter :authenticate_user!, except: [:index, :show, :form] before_filter :page_exists? before_filter :prepare_breadcrumbs respond_to :html, :js def create page.author = current_user page.save end def update page.update_attributes(params[:page]) end def destroy page.destroy unless page.is_root? end def form interaction.ip_address = request.remote_ip interaction.user_agent = request.user_agent interaction.update_attributes(content: params[:form]) end private def page_exists? not_found_page and return if page.nil? end def prepare_breadcrumbs page.path.each do |path| page.id == path.id ? add_crumb(path.title) : add_crumb(path.title, page_path(path)) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
quadro-0.5.3 | app/controllers/quadro/pages_controller.rb |
quadro-0.5.2 | app/controllers/quadro/pages_controller.rb |
quadro-0.5.1 | app/controllers/quadro/pages_controller.rb |