Sha256: f427b88942eb46e8b91046eddc9652b895fbb5ffc3526d643855bdd7b5f807fd
Contents?: true
Size: 720 Bytes
Versions: 49
Compression:
Stored size: 720 Bytes
Contents
class Wiki::SpacesController < ApplicationController before_filter :authenticate_user! def new @space = Space.new creator: current_user end def create @space = Space.new space_params.merge(creator: current_user) if @space.save redirect_to wiki_page_path(@space) else render :new end end def space_list @page = Page.find params[:id] @load_list = [] if params[:page_id].present? @until_page = Page.find params[:page_id] @load_list = @until_page.ancestor_ids end render layout: false end def load_till_space @page = Page.find params[:page_id] end private def space_params params.require(:space).permit(:title) end end
Version data entries
49 entries across 49 versions & 1 rubygems