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

Version Path
tawork-0.0.50 app/controllers/wiki/spaces_controller.rb
tawork-0.0.49 app/controllers/wiki/spaces_controller.rb
tawork-0.0.48 app/controllers/wiki/spaces_controller.rb
tawork-0.0.47 app/controllers/wiki/spaces_controller.rb
tawork-0.0.46 app/controllers/wiki/spaces_controller.rb
tawork-0.0.45 app/controllers/wiki/spaces_controller.rb
tawork-0.0.44 app/controllers/wiki/spaces_controller.rb
tawork-0.0.43 app/controllers/wiki/spaces_controller.rb
tawork-0.0.42 app/controllers/wiki/spaces_controller.rb
tawork-0.0.41 app/controllers/wiki/spaces_controller.rb
tawork-0.0.40 app/controllers/wiki/spaces_controller.rb
tawork-0.0.39 app/controllers/wiki/spaces_controller.rb
tawork-0.0.38 app/controllers/wiki/spaces_controller.rb
tawork-0.0.37 app/controllers/wiki/spaces_controller.rb
tawork-0.0.36 app/controllers/wiki/spaces_controller.rb
tawork-0.0.35 app/controllers/wiki/spaces_controller.rb
tawork-0.0.34 app/controllers/wiki/spaces_controller.rb
tawork-0.0.33 app/controllers/wiki/spaces_controller.rb
tawork-0.0.31 app/controllers/wiki/spaces_controller.rb
tawork-0.0.30 app/controllers/wiki/spaces_controller.rb