views:

27

answers:

1

How add hash parameter to url using redirect_to?

For example:

http://localhost/products/#{page:2}

A: 

Use the routing helpers. Assuming you use the resource Product

redirect_to product_url(@product)
Simone Carletti
I meant to add # to url using redirect_to for example: http://localhost/products/?type=1#\{ page:2 }. redirect_to :controller => :products, :action => :index, :type="1#\{page:2}".
Oksana