Added parent-child relationship to pages to visualize a breadcrump and subpages.
This commit is contained in:
parent
00619ccf55
commit
a8c93c08b7
24 changed files with 513 additions and 51 deletions
|
|
@ -12,7 +12,7 @@ class PagesController < ApplicationController
|
|||
|
||||
def show
|
||||
@page = Page.find_by_permalink(params[:permalink])
|
||||
|
||||
|
||||
if @page.nil?
|
||||
redirect_to new_page_path(:title => params[:permalink])
|
||||
elsif @page.redirect?
|
||||
|
|
@ -24,6 +24,7 @@ class PagesController < ApplicationController
|
|||
def new
|
||||
@page = Page.new
|
||||
@page.title = params[:title].gsub("_", " ") if params[:title]
|
||||
@page.parent = Page.find_by_permalink(params[:parent]) if params[:parent]
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue