Parse Date/DateTime from date_select parameters
This Rails helper allows simple parsing of params that have originated from ActionView’s date_select helper method into a Date or DateTime object in a consistent and clean way.
Page 16 of 21
This Rails helper allows simple parsing of params that have originated from ActionView’s date_select helper method into a Date or DateTime object in a consistent and clean way.
Last Friday, I headed off to Railscamp NZ with one guy from work, 8 cans of V, and a bag of carrots (my snack food of choice). Today it’s Wednesday, I’ve still got 8 cans of V, a few less carrots, one open-source application that I’m actually happy with (and Travis CI and CodeClimate say is pretty well put together),...
As a web developer, I’ve got a pretty good pick of websites - I know what companies are prepared to stick with tried and tested technologies, and combine it with just enough new stuff to make browsing their site pleasant and easy to do. Every now and then though, I’m forced out of my comfort zone, and need to find...
It’s not at all uncommon to be asked by a client “So, I’d really like to be able to edit that bit of the page just there - can we do that?”. The answer, of course, is yes, but managing content has no end of complexities. Just one of these many is publishing - that is, controlling content, where it...
On the Spot is a pet project that I tend to develop with bleeding-edge features in mind - something a bit more volatile than Latter, which is used heavily enough to justify a more cautious development process. In this post, I’m going to detail how I added HTML5 notifications to On the Spot, the upsides and downsides, and the Coffeescript...
Ever needed to store some secrets in Rails that you don’t want to share with the world? Yeah, same! In this post, I’m going to outline a really simple way to store your application’s secrets in a file called config/secrets.yml. Rails configuration and you First of all, let’s discuss exactly how this is going to work. If you’ve even configured...
I’ll be the first to admit that I’m not that great at design, especially typography and detailed elements. I’m just one of those people who can see what they want in their heads just fine, but something just goes…wrong…between the head and the page. In this post, I’m going to explain some of the lessons I learned while focussing on...
Often in the Rails projects I build, I have a need to store configuration that I don’t really want to have in my code. The most obvious way to do this is to either store the configuration in a YAML file (e.g. config/settings.yml), or in environment variables. Foreman is Heroku’s answer to these types of configuration challenges. It is used...
About the Application The idea behind On the Spot was to allow everyone in the office at work to control the playlist, so that there was some semblence of fairness about what we listen to. Probably the simplest way of showing you what it is is to see some pictures, right? Part 1: You can search for music Open Full-Size...
I get stung by this one all the time, and I can never remember how I fix it. I’m noting it down here, in the hope that next time I’m googling for a fix I’ll stumble across my own blog post. Adding network adapters (or refreshing the MAC address) of a virtual machine running a Debian-based OS on VirtualBox causes...