Posted By

insanedreamer on 07/16/10


testing rails console rails3

Versions (?)

Fetch a page from your site from console

 / Published in: Rails

Add this to .irbrc. Allows the following in console:

gethtml('/login') => HTML of whatever page is generated by /login

  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  

You need to login to post a comment.