RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

HTML Namespacing Rails plugin

HTML namespacing (release notes) automatically annotates your HTML partials with special class attributes, and it lets you write Sass files with rules automatically scoped to those classes. Should you feel the need, you can even scope JavaScript files to those classes.

Comments

How? By using parallel directory structures. In your Rails framework, you can create a convention to tie the following files together automatically: * app/views/foos/_foo.html.haml: specifies the HTML * app/stylesheets/views/foos/_foo.sass: specifies the CSS * app/javascripts/views/foos/_foo.js: specifies the JavaScript Release notes: http://adamhooper.com/eng/articles/6 Project page: http://github.com/adamh/html_namespacing

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in