Sha256: e60b28b359d377c76191cea4ce823663bdcb8f745e6aa35fee4601102f09642c
Contents?: true
Size: 1.05 KB
Versions: 4
Compression:
Stored size: 1.05 KB
Contents
class Manage::StructuresController < Manage::BaseController inherit_resources defaults :route_prefix => 'manage' before_filter :find_root, :only=>[:index] before_filter :find_structure, :only => [:edit, :update, :destroy, :move] load_and_authorize_resource cache_sweeper :structure_sweeper, :only=>[:create, :update, :destroy, :move] def create create!{ manage_structures_path } end def update update!{ manage_structures_path } end def destroy destroy!{ manage_structures_path } end # POST /manage/structures/1/move def move @structure.move_by_direction(params[:direction]) respond_with(@structure, :location => manage_structures_path) end protected def find_root @structure ||= Structure.with_kind(StructureType.main).with_depth(0).find(:first) @structure end def find_structure @structure = Structure.find_by_permalink(params[:id]) end def collection @structures = (@structures || end_of_association_chain).with_depth(1) end end
Version data entries
4 entries across 4 versions & 1 rubygems