GithubHelp home page GithubHelp logo

austinfromboston / haml-scaffold Goto Github PK

View Code? Open in Web Editor NEW

This project forked from norman/haml-scaffold

2.0 2.0 0.0 92 KB

Rails scaffold generator that outputs HAML and better functional tests.

Home Page: http://randomba.org

License: MIT License

haml-scaffold's Introduction

Haml Scaffold

A collection of hacks to the Rails scaffold generator, to make it output templates using Haml rather than ERB. You may like some of it, and may hate other parts. You’re free to use it under the terms of the MIT license if the parts you like outweigh the parts you hate.

This scaffold generator does the same thing as the default Rails scaffold generator, with a few differences.

Differences from Rails Scaffolding:

  • Haml not ERB.

Controller

  • Loads object with a before_filter to be DRYer.

  • “Destroy” method handles error conditions.

  • Actions are alphabetized for more obvious consistency.

  • Uses will_paginate.

Controller Test

  • Tests error conditions, not just the “happy-path.”

  • Has 100% code coverage with RCov.

  • Simplifies test method names and alphabetizes them for more obvious consistency.

  • Uses some very simple mocking with mocha to limit calls to the DB.

Views

  • Have cleaner, more semantic XHTML.

  • Are broken up into a couple of partials to be DRYer.

  • Use will_paginate.

Misc

  • Doesn’t generate a layout or CSS file.

Samples

View them here.

Installation

HAML Scaffold is available on RubyForge as a gem:

sudo gem install haml_scaffold

You can also install it as a Rails plugin if you wish:

./script/plugin install git://github.com/norman/haml-scaffold.git

Dependencies

The generated code will depend on:

You’ll need to add the gems and/or requires to your config/environment.rb manually.

Other stuff you might be interested in:

Author

Norman Clarke

This work is derived from code in Ruby on Rails and is released under its same license, the MIT License.

haml-scaffold's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.