This file contains 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
~/rails_apps/example.com% rails g scaffold -h | |
DEPRECATION WARNING: railtie_name is deprecated and has no effect. (called from <class:Railtie> at /Users/andrew/.rvm/gems/ruby-1.9.2-head@example/gems/will_paginate-3.0.pre/lib/will_paginate/railtie.rb:6) | |
/Users/andrew/.rvm/gems/ruby-1.9.2-head@example/gems/railties-3.0.0.beta4/lib/rails.rb:44:in `configuration': undefined method `config' for nil:NilClass (NoMethodError) | |
from /Users/andrew/.rvm/gems/ruby-1.9.2-head@example/gems/newrelic_rpm-2.12.3/lib/newrelic_rpm.rb:25:in `<top (required)>' | |
from /Users/andrew/.rvm/gems/ruby-1.9.2-head@example/gems/bundler-1.0.0.beta.1/lib/bundler/runtime.rb:48:in `require' | |
from /Users/andrew/.rvm/gems/ruby-1.9.2-head@example/gems/bundler-1.0.0.beta.1/lib/bundler/runtime.rb:48:in `block (2 levels) in require' | |
from /Users/andrew/.rvm/gems/ruby-1.9.2-head@example/gems/bundler-1.0.0.beta.1/lib/bundler/runtime.rb:47:in `each' | |
from /Users/andrew/.rvm/gems/ruby-1.9.2-head@example/gems/bundler-1.0.0.beta.1/lib/bundler/runtime.rb:4 |
This file contains 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 'http://rubygems.org' | |
gem 'rails', '3.0.0.beta4' | |
#Database stuff | |
gem 'mongoid', :git => 'git://github.com/durran/mongoid.git' | |
gem 'bson_ext' | |
gem 'carrierwave', :git => "git://github.com/jnicklas/carrierwave.git" | |
gem 'mini_magick', :git => 'git://github.com/probablycorey/mini_magick.git' |
This file contains 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 Driver = { | |
add: function(event) { | |
event.stop(); | |
$(this.get('rel')) | |
.insert(Driver.template(this)) | |
.subNodes().last().show('fade'); | |
}, | |
remove: function(event) { |
This file contains 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
require 'rubygems' | |
require 'eventmachine' | |
require 'em-http' # gem install em-http-request | |
require 'yajl' # gem install yajl-ruby | |
class String | |
def bold | |
"\033[1m#{self}\033[0m" | |
end | |
end |
This file contains 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
Nested = Behavior.create({ | |
initialize: function(options) { | |
this.options = Object.extend({ | |
evaluateScripts : true | |
}, options || {}); | |
this.container = this.options.container || 'li' | |
}, | |
_replace_ids : function (s){ | |
var new_id = new Date().getTime(); | |
return s.replace(/NEW_RECORD/g, new_id); |
This file contains 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
module Paperclip | |
class << self | |
def logger #:nodoc: | |
MongoMapper.logger | |
end | |
end | |
module ClassMethods | |
def has_attached_file name, options = {} | |
include InstanceMethods |
This file contains 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
u = User.new | |
u.images | |
NoMethodError: undefined method `images' for #<User:0x3666c98> | |
from /usr/local/lib/ruby/gems/1.8/gems/mongo_mapper-0.7.6/lib/mongo_mapper/plugins/dirty.rb:25:in `method_missing' | |
from (irb):9 | |
u.user_images | |
=> [] |
This file contains 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
NameError in Sessions#new | |
Showing app/views/layouts/application.html.erb where line #50 raised: | |
uninitialized class variable @@database_name in MongoMapper | |
Application Trace | |
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/mongo_mapper-0.7.0/lib/mongo_mapper.rb:57:in `database' | |
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/mongo_mapper-0.7.0/lib/mongo_mapper/document.rb:210:in `database' |
This file contains 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
belongs_to :creator, :class_name => "User", :foreign_key => "creator_id" | |
belongs_to :user, :class_name => "User", :foreign_key => "user_id" |
This file contains 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 UsersController < ApplicationController | |
#only showing new, but you'll most likely have index, show, edit, destroy and all those | |
def new | |
@user = current_group.users.new | |
end | |
def create | |
@user = current_group.users.new(params[:user]) |