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
// DELETE ALL DATA OF CURRENT IMPORT | |
// BASED ON ORDER_ID (SQL) | |
$table = new Application_Model_DbTable_Data(); | |
array(':order_id' => $Session->system_id); | |
$query = $table->getAdapter()->query('DELETE FROM data WHERE order_id = :order_id'); |
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 Account::CreditsController < ApplicationController | |
@menu_left = "menu left" | |
def index | |
end | |
def show |
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
!!! | |
%html{:xmlns => "http://www.w3.org/1999/xhtml"} | |
%head | |
%title | |
="> " | |
=yield(:title) || "" | |
= render :partial => 'shared/head' | |
%body | |
= render :partial => 'shared/header' |
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
routes | |
--------------------------- | |
devise_for :users do | |
get "/login" => "devise/sessions#new" | |
get "/logout" => "devise/sessions#destroy" | |
get "/signup" => "registrations#new" | |
get "/signup/:invitation_token" => "registrations#new" | |
get "/register/confirm" => "registrations#confirm" |
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
devise :users, :controllers => { :registrations => "registrations" } do | |
get "/login" => "devise/sessions#new" | |
get "/logout" => "devise/sessions#destroy" | |
get "/signup" => "registrations#new" | |
get "/signup/:invitation_token" => "registrations#new" | |
get "/register/confirm" => "registrations#confirm" | |
get "/register/confirmed" => "registrations#confirmed" | |
get "/register/photos" => "registrations#photos" | |
get "/register/import" => "registrations#import" |
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
@user = current_user | |
@profile = Profile.create(@user, params[:profile]) |
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
task :beta do | |
(1..100).each do |i| | |
ALPHABET = ('a'..'z').to_a | |
key = 10.times.map { ALPHABET.sample }.join | |
key = 10.times.inject('') { |s| s << ALPHABET.sample } | |
key = key.upcase | |
puts key | |
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
namespace :db do | |
desc("Create and insert shareable beta invtation codes") | |
task :populate => :environment do | |
# Create sharabe invitation codes | |
(1..100).each do |i| | |
ALPHABET = ('a'..'z').to_a | |
code = 8.times.map { ALPHABET.sample }.join |
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 StaticController < ApplicationController | |
def sub_layout | |
"right" | |
end | |
def show | |
@page_name = params[:page_name].to_s.gsub(/\W/, '') | |
@page_name = @page_name + "_" + I18n.locale.to_s | |
render (@page_name) |
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
validates :username, | |
:exclusion => {:in => ["admin", "root", "administrator", "superuser", "someone"], | |
:message => "is reserved" } | |
validates :email, | |
:exclusion => {:in => ["*@domain.*"], | |
:message => "email not allowed" } |
OlderNewer