html - How to "link_to" full path in rails 4? -
this code have
<a <%= link_to "open box", gig_path(@gig), class: "mcnbutton", target: "_blank", style: "font-weight: bold;letter-spacing: 0px;line-height: 100%;text-align: center;text-decoration: none;color: #ffffff;"%></a> from above <%= link_to "open box", gig_path(@gig)
note gig_path(@gig) gives me url http://gigs/3,and works well,it found gig need id:3 problem doesn't provide full url this
http://example.com/gigs/3 p.s. reference can @gig.title,@gig.description , works no problem.
to full url, use gig_url(@gig) instead of gig_path(@gig).
Comments
Post a Comment