0

I am using the High_Voltage gem to integrate static pages in my rails gem. I figured out how to link to anchors within a page (thanks to this previous answer. Now I also want to add a pop-up title to the links. I just randomly tried

link_to "About", page_path('indexpage', anchor: "aboutsection", title: "MyAboutTitle")

But this renders to

<a href="/pages/indexpage?title=MyAboutTitle#aboutsection">About</a>

and, logically, does not produce the desired result.
Any suggestion? Thanks!

R. Sierra
  • 1,076
  • 6
  • 19

1 Answers1

0

According to the Rail API for link_to to add html options, the title argument should be placed third in the method call, like this:

link_to "About", page_path('indexpage', anchor: "aboutsection"), title: "MyAboutTitle"

and it will output:

<a href="/pages/indexpage#aboutsection" title="MyAboutTitle">About</a>
R. Sierra
  • 1,076
  • 6
  • 19