Sha256: 479545c72c7206cbde8ae2a316dcf612f71e8bd8c69e279c2ce937c3160e41f2
Contents?: true
Size: 873 Bytes
Versions: 5
Compression:
Stored size: 873 Bytes
Contents
class WelcomeController < ApplicationController include MxitRails::Page def index input :phone_number, 'Enter your cellphone number' validate 'Custom validation message' do |input| logger.info "Validation: #{input.inspect}" # NB Don't put a return here - it causes much unhappiness input != 'custom' end validate :numeric, 'Please enter a numeric digits only' validate :min_length, 10, 'Numbers must be at least 10 digits long' validate :max_length, 11, 'Numbers cannot be longer than 11 digits' @time = Time.now.strftime '%H:%M:%S on %A' submit do if params[:phone_number] == '1234567890' redirect! :easter_egg end logger.info "This won't execute if an error occurred or if error! or redirect! was called" redirect! '/mxit/index/success' end end def easter_egg end end
Version data entries
5 entries across 5 versions & 1 rubygems