Jonathan Martin
Articles tagged “rails”
-
Backend, Meet Frontend: Managing Assets with Bower
~ by Jonathan Martin
TL;DR: Don’t manage vendor assets with Rails gems, use Bower and NPM. Checkout the gist for quick reference.
So you’ve knocked out a few epics in Pivotal Tracker and have an MVP ready for Heroku, when your project manager announces that the Bootstrap-based frontend and choice of colors will likely turn off investors.
To mitigate your “button-and-text soup,” he decides to hire a graphic designer and frontend developer to clobber your beautifully simple Rails app with masses of minified JavaScript, Convoluted Style Sheets, and litter your
slim
templates with classes and data attributes. -
Kissing Simplicity Goodbye
~ by Jonathan Martin
Simplicity concerns concepts and divisions more that it does lines of code. But you probably didn’t hear that from Kelly Johnson.
Keep it simple stupid.
The principle emphasizes that, contrary to what an average homegrown hacker might presume, complication isn’t a sign of brilliance: it signals a lack of investment. It shows the inability to break down and sift through the aspects of a problem domain to arrive at a solution that could be explained to a coworker in a couple sentences.
The sad reality is no tool can assess (or automate) simplicity; CodeClimate can’t tell me how well my knowledge boundaries are defined. Most of the time it does an impressive job at guessing through the causal relationship: a simpler model often yields simpler code. But not always.
That’s what you as a developer are employed to do: to keep it truly simple, not just for stupid people.
-
Short and Sweet: Why You Should Use Ancestry
~ by Jonathan Martin
I know I know, it’s been close to a month since I last blogged — that’s because I’ve been working and feeling hobby-lazy on the weekends, and I’m still in the middle of writing an approximately 6–8 page (single spaced!) essay, so I’m a little preoccupied…
Okay, what’s the deal with Ancestry?
First off, it’s a slick and polished gem — strike one. Second, it addresses a very common need — strike two. Finally, it is Rails 3 savvy and efficient — home run!
In all seriousness, Ancestry is perhaps one of the handiest gems I’ve used of late. Typically, setting up trees with ActiveRecord is relatively easy — but as the model logic grows, the ease of use/implementation fails. Query calls increase recursively with every layer of the tree, and scopes have to be manually called at each layer.
-
Rails 3: Forcing SSL
~ by Jonathan Martin
Once again, I found myself beating my way through a website todo, and again I painfully managed to complete the task. Perhaps I can spare you some of that pain with this discussion of SSL.
A nice convenience with the price of two late nights spent forcing my way through the seemingly most ridiculous bugs. What objective snatched away those precious hours of sleep?
Forcing SSL. That’s it. I implemented an administrator interface to my blog so I can easily post, comment, etc. (or else I’d never get time to write) however I was bugged every time I saw the basic http auth dialog with its warning: Your password will be sent unencrypted.
Naturally, I’m a conspiracy theorist and anticipate some foreign nation overtaking my blog and using it to bring about the end of the world (ok not really). However, having to type in
https://
every time I want to securely do my magic jumbo gets really irritating, and too many times have I authenticated without SSL. Way too many times.