Code Monkey home page Code Monkey logo

rails-snippets's Introduction

rails-snippets package

An atom package to add snippets for Ruby on Rails projects.

Developed with Ruby 1.9 syntax (key: 'value') and rails 4 onwards in mind, but most code in the snippets is going to work on Rails 3 too.

Contributions are greatly appreciated, if your favorite snippets are missing open an issue or send a pull request, I would ❤️ to merge your favorite snippets.

Please fork this repository and open a pull request to add / improve snippets.

Features

  • Snippets with nice defaults that are definitely going to save your a lot of time.

  • Support for the great package by @eddorre:

    demo

Toggle with: cmd + >

(In american keyboard: shift + cmd + .)

Conventions

The conventions for the snippets are usually the initials for the method.

Examples:

  • For validates_presence_of is vpo
  • For has_and_belongs_to_many is habtm
  • For <%= link_to 'hi', path %> is lt and so on.

Also if the method has an optional block like content_tag (snippet is ct), its block it's going to be adding block to the shortcut, in this case ctblock

Snippets list

Here are some of my favorites snippets, a complete list of snippets can be seen directly at the code or once the package is installed at Settings > Packages > Rails Snippets

=loop

=loop_demo

form_for and fsf

=form_for fsf

scope + (p l bd j jp)

=form_for fsf

  • proc
  • lambda
  • bd Between dates
  • joins
  • jpjoins & proc

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.