DEV Community

Robert Sfarzo
Robert Sfarzo

Posted on

1

Rails debugging

Fear Ye Not the Red Screen of Better Errors

Image description

  • Missing template N -- note controller#action render view's name, and check views for misspelled folder/file names, or missing view
  • No route matches -- compare routes.rb name to controller route name -- check form route exists in routes.rb -- check form route name
  • param is missing or the value is empty: PARAM_NAME -- match the view form element's name to the controller fetch.params name
  • undefined local variable or method NAME -- could be a local view var or method that is missing, but usually missed the @ for an instance variable that is defined in the controller#action
  • uninitialized constant SOMEController -- mispelled/non-matching controller name in routes.rb and the actual filename controllers\NAME_controller.rb
  • class/module name must be CONSTANT for controller -- probably not CamelCase controller name in controller file
  • always check logic, from math calcs to conditionals
  • if a view does not display a value, probably missing the = in <%= %>
  • be sure form text, elements, attributes match perfectly to spec, read more each test failure message and/or the actual test file
  • label && /ROUTE displays NAME entered when the form is submitted errors: match html labels for with the corresponding element id, *these errors cascade to numerous other errors, disappointing at first but a giant relief when corrected

Quadratic AI

Quadratic AI – The Spreadsheet with AI, Code, and Connections

  • AI-Powered Insights: Ask questions in plain English and get instant visualizations
  • Multi-Language Support: Seamlessly switch between Python, SQL, and JavaScript in one workspace
  • Zero Setup Required: Connect to databases or drag-and-drop files straight from your browser
  • Live Collaboration: Work together in real-time, no matter where your team is located
  • Beyond Formulas: Tackle complex analysis that traditional spreadsheets can't handle

Get started for free.

Watch The Demo 📊✨

Top comments (0)

Image of Stellar post

Check out Episode 1: How a Hackathon Project Became a Web3 Startup 🚀

Ever wondered what it takes to build a web3 startup from scratch? In the Stellar Dev Diaries series, we follow the journey of a team of developers building on the Stellar Network as they go from hackathon win to getting funded and launching on mainnet.

Read more

👋 Kindness is contagious

If this article connected with you, consider tapping ❤️ or leaving a brief comment to share your thoughts!

Okay