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 trialSarah A. Morrigan
14,329 Pointsbuggy code challenge again? (Stage 3 - Using Validations)
class Contact < ActiveRecord::Base
validates :city, length: {in 2..30}, presence: true
end
There is no discernible reason why this gives me an error.
It is exactly the same format as shown in video (2:31).
class Contact < ActiveRecord::Base
end
3 Answers
William Li
Courses Plus Student 26,868 PointsHi, Sarah, This line has minor bug
length: {in 2..30} # missed a colon after in
# should be
length: {in: 2..30}
Salman Akram
Courses Plus Student 40,065 PointsHi Sarah,
Under length, I find little missing coma (':') that should be like {in: 2..30}
class Contact < ActiveRecord::Base
validates :city, length: {in: 2..30}, presence: true
end
Sarah A. Morrigan
14,329 Pointsyikes! lol... duh
i need new glasses 8-)
Salman Akram
Courses Plus Student 40,065 PointsLol, yeah this is common minor mistakes like we don't know what's going on. :(