In your case:
<%= link_to "The name of your link", product_subjects_path(9) %>
Where 9 is the id of your product. You can use more generic link like:
<%= link_to "The name of your link", product_subjects_path(@product) %>
in a show view of a product, or even:
<h2>Links to subjects for each product </h2>
<% @products.each do |product| %>
<%= link_to product.title, product_subjects_path(product) %>
<% end %>
in an index.
Assuming that in your routes you have subjects nested under products:
resources :products do
resources :subjects
end
Don't forget when you are lost with your routes:
bundle exec rake routes
will give you all existing routes.
Here is the rails guide about routing with nested: doc
Here is the documentation for the syntax of the path: doc