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
#/usr/bin/env bash | |
set -e | |
set -x | |
apt-get update | |
apt-get upgrade | |
apt-get -y install build-essential curl git-core openssl libreadline6 libreadline6-dev \ | |
zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev \ |
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
Unable to load Sass. Please install it with one of the following commands: | |
gem install sass --pre | |
An exception occurred running bin/rails: | |
no such file to load -- enumerator (LoadError) | |
Backtrace: | |
Rubinius::CodeLoader#load_error at kernel/common/code_loader.rb:439 | |
Rubinius::CodeLoader#resolve_require_path at kernel/common/code_loader.rb:423 |
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
source 'https://rubygems.org' | |
ruby "2.1.0", engine: 'rbx', engine_version: '2.1.1' | |
gem 'rails', '4.0.1' | |
# Essential gems | |
# ------------------------------------------------------------------------------ | |
gem 'capistrano' | |
gem 'coffee-rails', '~> 4.0.0' | |
gem 'compass-rails', '~> 2.0.alpha.0' | |
gem 'figaro' |
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 VehiclesController < ApplicationController | |
def index | |
@vehicles = current_tenant.vehicles | |
respond_to do |format| | |
format.html | |
format.json { render json: VehiclesDatatable.new(view_context) } | |
end | |
end | |
def show |
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
# == Schema Information | |
# | |
# Table name: users | |
# | |
# id :integer not null, primary key | |
# email :string(255) default(""), not null | |
# encrypted_password :string(255) default("") | |
# reset_password_token :string(255) | |
# reset_password_sent_at :datetime | |
# remember_created_at :datetime |
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
# files_controller.rb | |
class FilesController < ApplicationController | |
def index | |
@files = Files.all | |
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
# | |
# Para conseguir que compile os assets locais, depois | |
# de muito quebrar a cabeça, eu achei em um post de | |
# como escrever o deploy.rb para o Capistrano 3 esta | |
# pérola, que fez tudo 'ir para frente': | |
# | |
# "Entre as inovações do Cap3 está a descontinuação | |
# da sua DSL própria e a adoção do Rake" | |
# | |
# Então precisava somente saber como trocar uma task |
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
var Validations = (function(){ | |
var Validation = function() { | |
var name = $("[name='nome']"); | |
var email = $("[name='email']"); | |
var empresa = $("[name='empresa']"); | |
var telefone = $("[name='telefone']"); | |
var mensagem = $("[name='mensagem']"); | |
var regex = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; |
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
# derived from http://railscasts.com/episodes/340-datatables | |
# handles server side multi-column searching and sorting | |
class Datatable | |
delegate :params, :h, :raw, :link_to, :number_to_currency, to: :@view | |
def initialize(klass,view) | |
@klass = klass | |
@view = view | |
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
namespace :foreman do | |
desc <<-DESC | |
Export the Procfile to upstart. | |
You can override any of these defaults by setting the variables shown below. | |
set :foreman_cmd, "foreman" | |
set :foreman_format, "upstart" | |
set :foreman_location, "/etc/init" | |
set :foreman_port, 5000 |