- Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
- rabl - General ruby templating with json, bson, xml, plist and msgpack support
- Thin - Very fast and lightweight Ruby web server
- Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
- SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
- Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
- [factory_girl](h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ApplicationController... | |
| def clear_cart | |
| @cart.destroy | |
| session[:cart_id] = nil | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class HospitalBooking | |
| def self.send_overtime_mail(user, bookings) | |
| OvertimeMailer.overtime_pdf(user, hospital_booking).deliver | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Api::TradesController < ApplicationController | |
| respond_to :json | |
| def index | |
| render json: DataTable.new(Trade, params) | |
| end | |
| def create | |
| trade = Trade.new(safe_params) | |
| trade.save |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| UPDATE pg_database SET datallowconn = TRUE where datname = 'template0'; | |
| \c template0 | |
| UPDATE pg_database SET datistemplate = FALSE where datname = 'template1'; | |
| drop database template1; | |
| create database template1 with template = template0 encoding = 'UNICODE' LC_CTYPE = 'en_US.UTF-8' LC_COLLATE = 'C'; | |
| UPDATE pg_database SET datistemplate = TRUE where datname = 'template1'; | |
| \c template1 | |
| UPDATE pg_database SET datallowconn = FALSE where datname = 'template0'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def create | |
| parent_resource = params[:parent_type].constantize | |
| parent_id = params[:parent_id] | |
| # both of the above values are empty because both params are not passed as parameters. | |
| @comment = parent_resource.find(parent_id).comments.create(comment_params.merge(account: current_account)) | |
| respond_with :dashboard, @comment | |
| end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def self.create_from_parent(parent_type, parent_id, comment_params, current_account) | |
| raise ActiveRecord::RecordNotFound unless POLYMORPHIC_ON.include?(parent_type) | |
| parent_type.constantize.find(parent_id).comments.create(comment_params.merge(account: current_account)) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%= form_for @contact, :remote => true, :url => contacts_path, :html => { :novalidate => '' } do |f| %> | |
| <% if SpreeContactUs.require_name %> | |
| <p> | |
| <%= f.label :name, :class=>'label-field-control' %> | |
| <%= f.text_field :name, class: 'form-control' %> | |
| </p> | |
| <% end %> | |
| <p> | |
| <%= f.label :email, :class=>'label-field-control' %> |
- 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
- Compass - Open source CSS Authoring Framework.
- Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
- Font Awesome - The iconic font designed for Bootstrap.
- Zurb Foundation - Framework for writing responsive web sites.
- SASS - CSS extension language which allows variables, mixins and rules nesting.
- Skeleton - Boilerplate for responsive, mobile-friendly development.