Skip to content

Instantly share code, notes, and snippets.

@toretore
Last active December 26, 2015 03:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toretore/7083915 to your computer and use it in GitHub Desktop.
Save toretore/7083915 to your computer and use it in GitHub Desktop.

Here's a quick introduction to how to get the best help in #rubyonrails (or any other programming medium). There are competent people who want to help you, but if you follow a few pointers you will make it much easier for them to do so and will get answers to your question much faster.

1. Show us your code

This is the most critical part. You absolutely must show us the code you're having problems with. It is incredibly important that you show us the relevant code. Trying to figure out a programming problem without code is like trying to fix a car without a car.

Use Gist to paste your code. Do not paste your code directly in the channel. Do not use Pastebin. Read this handy guide to learn how to use Gist properly.

Again, just to make sure you understand how incredibly important it is, you must show us your code, no way around it.

2. Show us all your code

Do not leave out parts of the code you think is not relevant to the problem. This means: Paste the entire file, not just parts of it. This means: No pasting just the "relevant" method from a controller or a model, or just the "relevant" parts of a view. It's all relevant.

You should also paste all relevant files (in their entirety, if that wasn't obvious by now). This usually means at least one for each letter in MVC: The model, the view and the controller. Most times, it means more than that too. Log output is sometimes very helpful. If you're dealing with outside data like a JSON document, paste that data. If you're running a cURL command, paste that. If you're having problems with a migration, paste the migration file and the relevant models. Et cetera; you get the point by now I hope.

2.1 No fake code

You must post exactly the code that you're running that results in the behavior you want help with. You may sometimes replace sensitive parts such as passwords, but you have to be very careful with leaving the logic intact.

3. Show us the error

You must also paste the entire stack trace from the error you're getting. The stacktrace has line numbers in it which map to lines in your files. If you don't paste the entire file as described above, these line numbers mean nothing and it makes it harder to see what's going on.


Remember, the people in #rubyonrails are doing this for free in their own time. They have no reason to help you other than to be helpful. You should respect this and make it as easy as possible for them to do so. A good gist is worth a million words.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment