Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 3rd, 2012  |  syntax: None  |  size: 0.40 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ########
  2.  
  3. class ActivationCode
  4.     include ActiveModel::Validations
  5.    
  6.     attr_accessor :activation_code
  7.     validates :activation_code, :presence => true
  8.  
  9.     def initialize(activation_code)
  10.       @activation_code = activation_code
  11.     end
  12. end
  13.  
  14. ########
  15. class CheckController < ApplicationController
  16.   def activation
  17.     u = ActivationCode.new :activation_code => params[:code]
  18.     u.valid?
  19.   end
  20. end