Duplicated content in rails

I’m having a problem related to duplicated content that I need to solve.

The problem is very simple, this url:


generates the same content like this one:


The fact is that I’m finding the real content using:


It means that country/region/title are not being evaluated when
resolving the url, maybe this is good, but the problem is that google
has indexed
and the right url as well.

1)I know that a canonical tag could be a solution, but how could I
get/define the canonical href with the right url

2)Do you know about a rails plugin/gem to handle such situations ?

I can not understand your problem But for
SEO purpose,
For customizing url containing Id

You can do

#in model
def to_param


@product = Article.find(params[:id])