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
validates_presence_of :email, :if => :sign_up | |
validates_presence_of :email, :first_name, :last_name, :add1, :add2, :id_number, :if => :edit_page | |
validates_uniqueness_of :email , :case_sensitive => true | |
attr_accessor :edit_page, :sign_up | |
references_many :transactions, :dependent => :delete, :inverse_of => :user | |
field :customer_id, type: Integer, default: 0 | |
field :title, type: String | |
field :first_name, type: String |
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
mongoid (2.0.2) lib/mongoid/relations/referenced/many.rb:219:in `block in load!' | |
mongoid (2.0.2) lib/mongoid/relations/referenced/many.rb:217:in `tap' | |
mongoid (2.0.2) lib/mongoid/relations/referenced/many.rb:217:in `load!' | |
mongoid (2.0.2) lib/mongoid/relations/referenced/many.rb:400:in `method_missing' | |
i18n (0.5.0) lib/i18n/exceptions.rb:41:in `block in initialize' | |
i18n (0.5.0) lib/i18n/exceptions.rb:41:in `each' | |
i18n (0.5.0) lib/i18n/exceptions.rb:41:in `initialize' | |
i18n (0.5.0) lib/i18n/backend/base.rb:37:in `new' | |
i18n (0.5.0) lib/i18n/backend/base.rb:37:in `translate' | |
i18n (0.5.0) lib/i18n.rb:155:in `translate' |
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 @user, validate: true do |f| %> | |
<% if @user.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2> | |
<ul> | |
<% @user.errors.full_messages.each do |msg| %> | |
<li><%= msg %></li> | |
<% end %> | |
</ul> |
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 User | |
include Mongoid::Document | |
devise :database_authenticatable,:registerable,:omniauthable,:recoverable, :rememberable, :trackable , :timeoutable , :confirmable #, :validatable | |
devise :encryptable, :encryptor => 'sha512' | |
validates_presence_of :email, :if => :sign_up | |
validates_presence_of :email, :first_name, :last_name, :add1, :add2, :id_number, :if => :edit_page | |
validates_uniqueness_of :email , :case_sensitive => true | |
attr_accessor :edit_page, :sign_up | |
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 ApiController < ActionController::Metal | |
include ActionController::Helpers | |
include ActionController::Redirecting | |
include ActionController::Rendering | |
include ActionController::Renderers::All | |
include ActionController::ConditionalGet | |
include ActionController::MimeResponds | |
include ActionController::RequestForgeryProtection | |
include ActionController::ForceSSL | |
include AbstractController::Callbacks |
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 App.Collections.Contacts extends Backbone.Collection | |
url: "/api/contacts" | |
model: App.Models.Contact |
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 "api" do | |
resources :contacts | |
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
match ':account_id/*path', to: 'launcher#index' |
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::ContactsController < ApiController | |
before_filter :authenticate_user! | |
def index | |
# magic goes here ... | |
end | |
# more magic ... | |
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
#!/usr/bin/env bash | |
apt-get -y update | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev | |
cd /tmp | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz | |
tar -xvzf ruby-1.9.3-p194.tar.gz | |
cd ruby-1.9.3-p194/ | |
./configure --prefix=/usr/local | |
make | |
make install |
OlderNewer