It’s late so I’ll be brief. I crushed my project tonight and I’m ready to start my Sinatra portfolio project tomorrow. I think I can have an ugly version (desktop down design, raw forms, no nav bar or footer) done tomorrow at some point and then leave it alone until after my project review with an instructor. We’ll see how that goes. The requirements are:
- Build an MVC Sinatra Application.
- Use ActiveRecord with Sinatra.
- Use Multiple Models.
- Use at least one
has_many
relationship - Must have user accounts. The user that created a given piece of content should be the only person who can modify that content
- You should validate user input to ensure that bad data isn’t created
So it might be ambitious to think I can finish that in a day or two but I’m confident I can with what I have planned.
I was able to utilize Active Record Validations tonight. I also included HTML5 required
tags in my forms. However, the tests were sending raw params data to the post route so it was bypassing utilizing my forms to test. I guess this is good though because it creates a situation where if someone sends bad data to the server through a method other than the server it’ll reject it. However, I wouldn’t want the server hit every time a bad form is input. Maybe a combo of the two makes sense? That way data is validated in the browser and when being saved to the server. Here’s what an Active Record Validation looks like from Rails Guides:
class Person < ApplicationRecord
validates :name, presence: true
end
Person.create(name: "John Doe").valid? # => true
Person.create(name: nil).valid? # => false
I also decided to buy the Cast Iron Design Eco Pocket-Sized Notebook pack of 3 to start. I realized that AMEX is offering a bonus if you redeem points towards purchases until the end of the month. While redemption values are almost always lowest when using AMEX points for bill credits with the 20% bump it’s worth using for a few small things. Considering we have 70k of them $12 won’t make a dent in that. I still plan to get a Code & Quill Origin when they’re not sold out anymore. The fact that there are spacing markers that will make written code look good is sweet (not like you can’t do that on graph paper but still).
I think one of the biggest things I’ve been doing that has helped me not get bogged down as I’m moving through the curriculum and projects is to not get too fancy. I’m also not overthinking it. I’m being very straightforward in what I’m putting together and making things that work. Could pretty much everything be better? Yes. However, I’m looking to have a body of work to present. I honestly feel that when it comes job hiring time the strength of the code will outweigh the shiny UI’s. I still plan on going back and polishing everything up and making it look nice (or at least nicer) than the project requirements require.
Time spent today: 3:13
Time spent total: 182:20
Lessons completed today: 1
Lessons completed total: 405