HR Stuff and Blog UI
HR Stuff and Blog UI Updates Spent most of the day getting my paperwork done for 8th Light. I will be starting as a resident apprentice on Monday 5/6.
I went home and slept until 11pm. When I awoke, I decided I was going to work on the Blog’s UI a bit.
I created a new field called
published_at that combined what
time did. The difficult part was that I also wanted to combine the data. I
know how to do it in SQL, but I wanted to find a Rails way. Here’s the final
published_at to a
The alternative way to update
published_at was to do something like this.
It’s a bad habit to iterate through each object because this would generate a
sql command for each row. By using
update_all, there is one sql command so
this would scale for large datasets.
I’ve been annoyed by the 80 column print margin that shows up on the editor when entering a new blog entry. After a lot of googling and trial and error, I came upon this winning workflow.
- In Chrome, go to the webpage that contains the editor.
You should see that the console will try to complete the method. If you scroll
through, you’ll see something promising
setShowPrintMargin. So if you call
you’ll see the print margin disappear.
I ran into a problem in the beginning because the example code on JQueryUI used
datepicker("option", "dateFormat", "yy-mm-dd") but I wasn’t able
to get it to work.