Hi!
Very silly question, but how do you use link_to with an anchor, for
example:
www.website.com/articles/123#comments ?
Just can’t figure out!
Thank you!
Hi!
Very silly question, but how do you use link_to with an anchor, for
example:
www.website.com/articles/123#comments ?
Just can’t figure out!
Thank you!
Nauhaie N. wrote:
Hi!
Very silly question, but how do you use link_to with an anchor
link_to ‘mylink’, {:controller => â??postsâ??,
:action => â??showâ??,
:id => 10,
:anchor => â??commentsâ??}
From the url_for documentation:
:anchor â?? specifies the anchor name to be appended to the path. For
example, url_for :controller => â??postsâ??, :action => â??showâ??, :id => 10,
:anchor => â??commentsâ?? will produce “/posts/show/10#comments”.
Nice! Thanks a lot!
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs