Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8863493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:59:31+00:00 2026-06-14T15:59:31+00:00

I was wondering how to exit a controller in rails and get the output

  • 0

I was wondering how to exit a controller in rails and get the output up to that point.

In PHP I often used the “exit” when debugging to get only the data processed to that point. I haven’t found a sollution to this in rails.

If you get a error further down in the code the view is locked from displaying <%= debug %> information.

Some would suggest console or rescue, and I know about these. But isn’t there a simpler solution?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T15:59:33+00:00Added an answer on June 14, 2026 at 3:59 pm

    In development mode, I often just use puts or awesome_print to print something to the screen that I ran rails server from. That works pretty well for the simple cases.

    For anything more complex than that, I use ruby-debug or pry to drop down into an interactive console when it hits the right point.

    I have some editor shortcuts to print one of these two snippets:

    require 'pry'; binding.pry
    require 'ruby-debug'; debugger
    

    Drop these in your code and you can use IRB to inspect (and manipulate) the state of your program.

    I highly recommend you give pry a shot. Check it out here:

    http://pryrepl.org/

    http://railscasts.com/episodes/280-pry-with-rails

    There is also the older ruby-debug:

    http://railscasts.com/episodes/54-debugging-with-ruby-debug

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Wondering if there is any way to get the lambda expressions that result from
Wondering if any of you can help me: I've made a signup modal that
Wondering if anyone can suggest a good file replication tool that will replicate across
Wondering if there is a good way to generate temporary URLs that expire in
I have an ASP.NET MVC2 application that uses a parent controller to setup specific
Just wondering why import sys exit(0) gives me this error: Traceback (most recent call
I was wondering how someone can specify an exit code when shutting a XULRunner
I know EXIT_SUCCESS / EXIT_FAILURE is typically used for main() exit to indicate the
Just wondering whether an object can self-destruct. Consider this situation. An object that extends
Just wondering whether an object can self-destruct. Consider this situation. An object that extends

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.