give user paths a canonical tag

This commit is contained in:
Emi Matchu 2011-07-26 18:56:14 -04:00
parent 033e71e9bf
commit e6c419c7e0
4 changed files with 11 additions and 2 deletions

View file

@ -29,6 +29,10 @@ module ApplicationHelper
content_tag(:div, html, :class => 'campaign-progress-wrapper')
end
def canonical_path(resource)
content_for :meta, tag(:link, :rel => 'canonical', :href => url_for(resource))
end
def flashes
raw(flash.inject('') do |html, pair|
key, value = pair

View file

@ -9,6 +9,8 @@
- else
- title "#{@user.name}'s Items"
- canonical_path user_closet_hangers_path(@user)
- content_for :before_flashes do
#closet-hangers-contact
- if public_perspective?

View file

@ -1,4 +1,7 @@
- title 'Recent Contributions'
- if @user
- canonical_path user_contributions_path(@user)
%ul.buttons
- if @user
%li= link_to 'Recent Contributions', contributions_path, :class => 'button'
@ -15,3 +18,4 @@
= will_paginate @contributions
%ul.contributions= render @contributions
= will_paginate @contributions

View file

@ -1,6 +1,5 @@
- title @item.name
- content_for :meta do
%link{:rel => 'canonical', :href => url_for(@item)}
- canonical_path @item
- cache "items_show_#{@item.id}_main_content" do
%header#item-header