small medium large xlarge


Modify the user update function to accept a confirmed password instead of a hashed password and a salt. Discuss

When the system is freshly installed on a new machine, there are no administrators defined in the database, and hence no administrator can log on. But, if no administrator can log on, then no one can create an administrative user. Change the code so that if no administrator is defined in the database, any username works to log on (allowing you to quickly create a real administrator). Discuss

Experiment with rails console. Try creating products, orders, and line items. Watch for the return value when you save a model object—when valida- tion fails, you’ll see false returned. Find out why by examining the errors:

>> prd = => #<Product id: nil, title: nil, description: nil, image_url: 
nil, created_at: nil, updated_at: nil, price: 
=> false 
>> prd.errors.full_messages 
=> ["Image url must be a URL for a GIF, JPG, or PNG image",
    "Image url can't be blank", "Price should be at least 0.01", 
    "Title can't be blank", "Description can't be blank"]


Page History
  • V18: Denis Hovart [over 1 year ago]
  • V17: eric tenne [about 2 years ago]
  • V16: Sam Ruby [over 6 years ago]
  • V15: Sam Ruby [over 6 years ago]
  • V14: Sam Ruby [over 6 years ago]
  • V13: Sam Ruby [over 6 years ago]
  • V12: Sam Ruby [over 6 years ago]
  • V11: Andrew de Andrade [over 7 years ago]
  • V10: Andrew de Andrade [over 7 years ago]
  • V9: Andrew de Andrade [over 7 years ago]