Fetch a page from your site from console


/ Published in: Rails
Save to your folder(s)

Add this to .irbrc.
Allows the following in console:
> gethtml('/login')
=> HTML of whatever page is generated by /login


Copy this code and paste it in your HTML
  1. class Object
  2. def gethtml(options = {})
  3. url=app.url_for(options)
  4. app.get(url)
  5. puts app.html_document.root.to_s
  6. end
  7. end

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.