Skip to content

Instantly share code, notes, and snippets.

View ch1ago's full-sized avatar
🏠
Working mostly from home since 2006

Thiago Almeida ch1ago

🏠
Working mostly from home since 2006
  • Mexico City
View GitHub Profile
class user
GENDERS = {'-'=>'0','user.gender.female'=>'1','user.gender.male'=>'2'}
<%= select("user", "gender", User::GENDERS) %>
<select id="user_gender" name="user[gender]">
<option value="0" selected="selected">-</option>
<option value="1">user.gender.female</option>
<option value="2">user.gender.male</option>
# encoding: utf-8
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable, :lockable and :timeoutable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable,
:lockable
attr_accessible :full_name, :gender, :gender_policy, :birth, :birth_policy,
:time_zone, :background, :background_repeat_policy, :flavour, :description,
Started POST "/users/sign_in" for 127.0.0.1 at 2010-10-05 20:07:17 -0300
Processing by Devise::SessionsController#create as HTML
see the email...
Parameters: {"utf8"=>"✓", "authenticity_token"=>"elrXWCO9RutTWORYs/Z40EJLPJUZ1SLHCPwjWyva44M=", "user"=>{"email"=>"flavio@executter.com", "password"=>"[FILTERED]", "remember_me"=>"1"}, "commit"=>"Sign in"}
see the query...
User Load (0.6ms) SELECT "users".* FROM "users" WHERE ("users"."email" = 'thiago') LIMIT 1
Completed in 246ms
Started GET "/" for 127.0.0.1 at 2010-10-02 02:15:44 -0300
Processing by SiteController#index as HTML
User Load (0.5ms) SELECT "users".* FROM "users" WHERE ("users"."email" = 'admin') LIMIT 1
Rendered site/index.html.erb within layouts/application (9.8ms)
Completed 200 OK in 64ms (Views: 18.5ms | ActiveRecord: 0.5ms)
devise_for :users
Started POST "/users/sign_in" for 127.0.0.1 at 2010-10-02 00:10:31 -0300
Processing by Devise::SessionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"CRun42vZBTbwx2XxzFWg/dYfItt/UIAyuJ9kIkxEvkQ=", "user"=>{"email"=>"thiago@oficina7.com", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Sign in"}
User Load (0.4ms) SELECT "users".* FROM "users" WHERE ("users"."email" = 'admin') LIMIT 1
Completed in 31ms
Processing by Devise::SessionsController#new as HTML