21 lines
467 B
Ruby
21 lines
467 B
Ruby
|
class BreadcrumbWidgetsController < ApplicationController
|
||
|
def widget
|
||
|
params = OrbitHelper.params
|
||
|
url = params["url"]
|
||
|
crumbs = url.split("/")
|
||
|
data = []
|
||
|
crumbs.each do |crumb|
|
||
|
if crumb == ""
|
||
|
p = Page.root
|
||
|
data << {"page_name" => p.name, "url" => "/#{locale.to_s}" + p.url}
|
||
|
else
|
||
|
p = Page.where(:page_id => crumb).first
|
||
|
data << {"page_name" => p.name, "url" => "/#{locale.to_s}" + p.url}
|
||
|
end
|
||
|
end
|
||
|
{
|
||
|
"crumbs" => data
|
||
|
}
|
||
|
|
||
|
end
|
||
|
end
|