how to add a string to the path in link_to of ruby on rails -


for example have code:

<%= link_to "start", start_path(:id=>1,:box=>1)%> 

the id , box parameters right? , example, generated url: http://localhost:3000/start?id=1&box=1

how can add string it, make this:

http://localhost:3000/start?id=1&box=1#box_1

use :anchor key:

<%= link_to "start", start_path(:id => 1, :box => 1, :anchor => 'box_1') 

and answer first question, yes, id , box parameters. passed in request part of params hash.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -