Skip to content

Instantly share code, notes, and snippets.

View vinniefranco's full-sized avatar
🏡
WFH

Vincent Franco vinniefranco

🏡
WFH
View GitHub Profile
We couldn’t find that file to show.
class Article < ActiveRecord::Base
def image=(file)
uploader = ArticleUploader.new
uploader.store!(file)
self.small = uploader.small.url
self.original = uploader.url
end
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
#
[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] ----------------------------------------------------------------
class Admin::PostsController < ApplicationController
before_filter :authenticate_user!
respond_to :json
def index
@posts = Post.asc(:created_at)
respond_with(@posts)
end