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: Discuss


 >> prd = Product.new 
 => #<Product id: nil, title: nil, description: nil, image_url: 
nil, created_at: nil, updated_at: nil, price: 
#<BigDecimal:246aa1c,'0.0',4(8)>> 
 >> prd.save 
 => 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"]