def canonical_link_tag( url_for_options = nil )
      url = canonical_url_from( url_for_options || @_canonical_url_for_options || request.url )
      tag( :link, :rel => 'canonical', :href => url ) if url # custom url methods may sometimes return nil --R
    end
def canonical_link_tag( url_for_options = nil )
      url = canonical_url_from( url_for_options || @_canonical_url_for_options || request.url )
      tag( :link, :rel => 'canonical', :href => url ) if url # custom url methods may sometimes return nil --R
    end
tag to include within your HTML header, e.g.:
   <%= canonical_link_tag %>