简体   繁体   中英

Display current page in rails haml template

I know this is crazy simple, but I can't figure it out even after reviewing the HAML docs. How do you return the current page/path (current_page). I want to add a simple share on Twitter link to my app that contains the current path.

%a.twitter{href: "https://twitter.com/intent/tweet?url=CURRENT_PAGE_?????&text=#{blah}"} Tweet

Use request.url . It's available in controllers and views.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM