Commit 5bb48fd4 authored by Martin Markech's avatar Martin Markech
Browse files

redirect page/1 for non-XHR, to get unique urls in Google

parent 08d91e35
Refinery::Core::Engine.routes.draw do
match "*path/page/:page" => "pages#show", :as => :page
match "*path" => "pages#show", :as => :page , :page => 1
# To have unique url adress in Google
get "*path/page/1" => redirect("/%{path}")
get "*path/page/:page" => "pages#show", :as => :page, :constraints => {:page => /[1-9]+/} # 1-9 because I want will_paginate render page/1 link for XHR, but I dont want page/1 for non-XHR
namespace "photo_gallery", :path => '' do
namespace :admin, :path => 'refinery' do
......
......@@ -9,6 +9,8 @@ module Refinery
def wrap_show_action
params[:page].blank? ? params[:page] = 1 : params[:page]
if request.xhr?
respond_to do |format|
format.js { render :partial=> "/refinery/photo_gallery/albums/photos"}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment