I love your style: Learning Ruby on Rails

Having spent just over two years working as a front-end developer on Ruby on Rails projects I’ve become pretty handy with ERB, HAML & SASS but when it comes to looking further into the back-end stack I’ve been hesitant to do anything except look at the code and write the occasional simple helper for my views. I’ve had an idea for a while and I decided to bite the bullet and make it myself.

The site is I love your style. The idea is to be able to ask beauty or fashion questions directly to those people you admire, as an aside you can also ask the wider community. The grand vision is for it to be a Stack Overflow for beauty and fashion. Continue reading

The placeholder attribute

Translations: French

For years designers have overlaid labels onto input fields in order to save screen real-estate. As front-end developers we implement this using absolute positioning and event handlers to move the label offscreen once the user has focused into the field. User focuses; label disappears.

The placeholder attribute was introduced in HTML5 and has since been misused in order to replicate the functionality described above. Let me set this out very clearly before we move on, the placeholder attribute IS NOT a replacement for a label. Continue reading

Click event handler iPhone: non-anchor elements

I have a results table where each row is a form and the user continues by pressing the submit button for that result. At smaller widths I collapse the table, hide the submit button and add a click event handler to the tr – it works fine, up to a point.

A filter bar was added that uses AJAX to reorder and add to the results so now the DOM is being generated with JS. Usually you can use .on(event, selector, handler) to catch any generated elements, but this won’t work on iPhone or iPad*. Continue reading