/ Published in: Rails
Add this to .irbrc.
Allows the following in console:
> gethtml('/login')
=> HTML of whatever page is generated by /login
Allows the following in console:
> gethtml('/login')
=> HTML of whatever page is generated by /login
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
class Object def gethtml(options = {}) url=app.url_for(options) app.get(url) puts app.html_document.root.to_s end end