something more specific • “My data isn’t being saved in the database”: is it because of the form, the controller or the model? • Can you recreate the problem in the rails console? • Error messages: which line of code is responsible?
requests, parameters, SQL queries • Use the debugger to interact with code as it runs • Log extra information def do_thing(parameter) Rails.logger.info "do_thing called with #{parameter}” ... end
• Explain to an (imaginary) rubber duck what that line is, what the values of variables are, what all the method calls it does are • Forces you to think about your code and any assumptions made (question them!)
don’t lead with a wall of code • Include error messages, stack traces (and how they related to the code you post) • Describe your investigations & attempts to fix this • Provide information such as ruby or rails versions, OS