Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
TJ Takei
13,362 PointsConsolidation of "Added todo list item." message is a good idea?
Two files, app\controllers\todo_items_controller.rb and spec\features\todo_items\create_spec.rb, have the message "Added todo list item." Since I had a hard time to correct a typo in them, I like to avoid that kind of "waste of time debugging" by replacing them with a common global variable. Is it an good idea to do so? If so, where to put it?
1 Answer
Maciej Czuchnowski
36,441 PointsCan't tell if it's a good idea in this case. But if you want a global variable that is available in various places, I guess you could put it in the model or use an initializer.