I'm looking in the database for my pages:
select * from refinery_pages \G
I notice that the "path" field is empty on every record. Here is an example:
*************************** 5. row ***************************
id: 6
parent_id: NULL
path: NULL
slug: community
custom_slug: NULL
show_in_menu: 1
link_url:
menu_match: NULL
deletable: 1
draft: 0
skip_to_first_child: 0
lft: 13
rgt: 14
depth: 0
view_template: show
layout_template: NULL
created_at: 2015-04-04 02:39:56
updated_at: 2015-04-09 17:36:41
I wanted to build a menu of the pages that are children of other pages. This works if I am on the parent page:
current_page_relation = Refinery::Page.friendly.where(slug: params[:path])
If I am on page called Education there in this case the path will be "education" and the slug will be "education" so everything works out great.
However, if I am on a child page such as "library" then the path is:
education/library
whereas the slug is:
library
I can always split on the "/" but I am curious, is the field "path" suppose to fill in automatically? I'm confused why it doesn't fill in for me.