Skip to content

Instantly share code, notes, and snippets.

View tanelsuurhans's full-sized avatar

Tanel Suurhans tanelsuurhans

  • ID.me
  • United States
View GitHub Profile
class MyModel < ActiveRecord::Base
attr_accessible :my_attribute
def my_attribute=(value)
# do something else here...
write_attribute(:my_attribute, value)
end
end
def minimum_bet_validation
errors.add(:base, _("minimum_bet", :value => 10)) if name == Setting::MINIMUM_BET && value.to_i < 10
end
if value.to_i < 10
$ ->
if $('h1.claim a').length > 0
$.mobile.ajaxEnabled = false
if $('.purchase_form').length > 0
$.mobile.ajaxEnabled = false
# This is what I'd _like_ to do.
# link_to user_album(user, album)
# link_to user_blog(user)
resources :users, :path => '' do
resources :albums
resources :blogs
end
class ImportController << ApplicationController
require 'net/http'
require 'net/https'
require 'uri'
#THIS METHOD TO SEND USER TO THE GOOGLE AUTHENTICATION PAGE.
def authenticate
# initiate authentication w/ gmail
# create url with url-encoded params to initiate connection with contacts api