This is a very basic question with probably an easy answer. Let's say I have a model called Product. When I add
map.resources :products
to my routes.rb I have access to some default paths new_product_path, edit_product_path and so on. As I understand this should be used when linking to a resource e.g. using the link_to helper method:
link_to "Edit Product", edit_product_path(@product)
My question is: What do I do when I have other controller methods like for example
def do_something
...
end
What's the "best" way to link to this controller method?
link_to "Do Something", {:controller => 'products', :action => 'do_something', :id => @product.id}
for sure would work. But is that what I should use?
I hope I made my point clear! Please comment if not. I'll try to explain it better then.