Skip to content

24 ways to impress your friends

Vote down?

Dan Glegg

Great article! I’m currently working on a project that needs some inline editing – however, there’s an additional kicker in that some editables are not text-only. Within the rails app, the editor needs to support custom “read” and “write” partials to dump into the editor form.

I’ve implimented it using a regex to properly escape any quotes in the partials and dumping them into the onclick call on the editable element.

Early days yet but so far it looks like this:

couple of points:-

1. I’m using position: absolute because some editable elements are in small screen areas that will not contain a form in a presentable manner.

2. I’m fading down the opacity on the edited element for additional feedback.

Hope that’s of use to someone out there. Keep up the great work with this site.