SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Zealot ricklach's Avatar
    Join Date
    Nov 2004
    Location
    Victoria BC
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Echoing output in ROR

    Is there a simple way (like php echo) to print to screen, lists of various variables for a quick check?

    Rick

  2. #2
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    California
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could always set a flash.now variable or log it. Flash would be:
    Code:
    flash.now[:debug] = 'My stuff'
    Then in the view:
    Code:
    <%= @flash[:debug] %>
    That way, if there is no debug data, nothing is shown, but if there is, it will be outputted. Otherwise that you can log it, but I don't really remember how to do that, sorry.
    Happy switcher to OS X running on a MacBook Pro.

    Zend Certified Engineer

  3. #3
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The debug() function:

    <%= debug(@posts) %>

    Use in views. You can also use the breackpointer script to examine variables in real-time.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •