Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View schadenfred's full-sized avatar

Frederick Schoeneman schadenfred

  • Handsome Fencer
  • Spokane, WA
View GitHub Profile
class RegistrationsController < Devise::RegistrationsController
def new
super
end
def create
@user = User.new(params[:user])
if @user.name.blank?
params[:user][:name] = temporary_name
'devise_for :users, :controllers => {:registrations => "registrations"}
Sadly, it still doesn't work with this registration controller code:
def create
if params[:user] && !params[:user][:password] && !params[:user][:name]
params[:user][:password] = "Some password"
params[:user][:password_confirmation] = "Some password"
params[:user][:name] = "Some name"
super
@schadenfred
schadenfred / gist:1091092
Created July 19, 2011 01:14
log output, showing that the registration form isn't submitting a name
ted GET "/assets/application.css" for 127.0.0.1 at 2011-07-18 17:57:44 -0700
Served asset /application.css - 304 Not Modified (0ms) (pid 2954)
Started POST "/users" for 127.0.0.1 at 2011-07-18 17:58:34 -0700
Processing by Devise::RegistrationsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"QzKJHlAtt31RixixWixQWr2OPmeEVRD9odGxSs7znS8=", "user"=>{"name"=>"", "email"=>"SarahSilverman@gmail.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
(0.1ms) SELECT 1 FROM "users" WHERE "users"."email" = 'sarahsilverman@gmail.com' LIMIT 1
(0.2ms) SELECT 1 FROM "users" WHERE LOWER("users"."name") = LOWER('') LIMIT 1
(0.1ms) SELECT 1 FROM "users" WHERE LOWER("users"."email") = LOWER('sarahsilverman@gmail.com') LIMIT 1
@schadenfred
schadenfred / gist:1091091
Created July 19, 2011 01:14
log output, showing that the registration form isn't submitting a name
ted GET "/assets/application.css" for 127.0.0.1 at 2011-07-18 17:57:44 -0700
Served asset /application.css - 304 Not Modified (0ms) (pid 2954)
Started POST "/users" for 127.0.0.1 at 2011-07-18 17:58:34 -0700
Processing by Devise::RegistrationsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"QzKJHlAtt31RixixWixQWr2OPmeEVRD9odGxSs7znS8=", "user"=>{"name"=>"", "email"=>"SarahSilverman@gmail.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
(0.1ms) SELECT 1 FROM "users" WHERE "users"."email" = 'sarahsilverman@gmail.com' LIMIT 1
(0.2ms) SELECT 1 FROM "users" WHERE LOWER("users"."name") = LOWER('') LIMIT 1
(0.1ms) SELECT 1 FROM "users" WHERE LOWER("users"."email") = LOWER('sarahsilverman@gmail.com') LIMIT 1
source ~/.bashrc
if [[ -s /home/frederick/.rvm/scripts/rvm ]] ; then source /home/frederick/.rvm/scripts/rvm ; fi
We couldn’t find that file to show.
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
if [[ ! -z "$PS1" ]] ; then
# don't put duplicate lines in the history. See bash(1) for more options
# don't overwrite GNU Midnight Commander's setting of `ignorespace'.
export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups