Forum: Ruby url as breadcrumbs

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9973f381a0f24b8297883eb842371608?d=identicon&s=25 Rakesh Kumar (ecomrails)
on 2016-09-08 08:32
Hi everyone,

I have been tasked with an assignment, as per advice from the marketing
dept. (SEO friendly url) where I would need to replace the url structure
from :-

Current URL Washing Machine is:
http://localhost:3000/products?product_category_id...
Custom URL for the same page should be: (as per bread-crumbs)
http://localhost:3000/HomeEssentials/Cleaning&Dryi...
Where HomeEssentials > Cleaning&Drying > WashingMachine is the bread
crumbs, and it has the parent child menu structure.

This has to happen at every product category, and for ex,
product?product_category_id=35#Football, in terms of breadcrumbs :-
Home > Sports & Leisure > Football.
(leading to a url like -
http://localhost:3000/Home/Sports&Leisure/Football.)

I have had a look at friendly url gem, and stubs, and changing to_param
in the model , but that effectively replaces the id with the title/name,
or any parameter we set. However it does not replace the entire url, in
the manner as expected.
(the answer probably lies in changing the routes file, (mapping, etc)
but have not received much success in my search so far).
Currently, the request is being generated from the home page, into the -
> products controller and the parameter product category id is being
passed.

<li><%=
link_to subMenuCat_tab.name, products_path(:product_category_id =>
subMenuCat_tab.id) %></li>

Any suggestion / help in this regards would be highly appreciated.

Thanks,
Rakesh
This topic is locked and can not be replied to.