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 Article < ActiveRecord::Base | |
def image=(file) | |
uploader = ArticleUploader.new | |
uploader.store!(file) | |
self.small = uploader.small.url | |
self.original = uploader.url | |
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
class Example | |
def initialize(name) | |
# this means there is an instance var of name in this object. | |
@name = name | |
end | |
# This is the ruby equivilant to this JS class method | |
# |
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
[INFO] firing openInit | |
[INFO] inside init.js | |
[INFO] Available memory: 1178.80859375 | |
callback = gotInfo; | |
method = "account.getInfo"; | |
} | |
[INFO] ***********************************************************start | |
[INFO] ---------------------------------------------------------------- | |
[INFO] >>> openConnection :: Mon Dec 20 2010 10:39:09 GMT-0800 (PST) | |
[INFO] ---------------------------------------------------------------- |
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 Admin::PostsController < ApplicationController | |
before_filter :authenticate_user! | |
respond_to :json | |
def index | |
@posts = Post.asc(:created_at) | |
respond_with(@posts) | |
end |
NewerOlder