last day (236 days later) » 

10:53 PM
Alright
 
hi
Can you show the ApplicationController
 
Hi, thanks for helping.
yes
 
No Problem
 
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception


protected

def configure_permitted_parameters
devise_parameter_sanitizer.for(:sign_up) << :first_name << :last_name << :email << :password << :password_confirmation
end


end
tried with just the first and last name
 
Where is the call
before_filter :configure_permitted_parameters, if: :devise_controller?
 
10:55 PM
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception


before_filter :configure_permitted_parameters, if: :devise_controller?

include SessionsHelper

protected

def configure_permitted_parameters
devise_parameter_sanitizer.for(:sign_up) << :first_name << :last_name << :email << :password << :password_confirmation
end
 
you don't need to add email, password and password_confirmation in configure_permitted_parameters
 
sorry, it was in there
I just missed it when copying and pasting
 
So remove that, as its already added by Devise
okies
run it and check now
Keep only
def configure_permitted_parameters
devise_parameter_sanitizer.for(:sign_up) << :first_name << :last_name
end
without email, password and password_confirmation
 
nope
Processing by Devise::RegistrationsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"4KvHBYLTXs+wRAyB/1d5DKRVRqWO3eFKWyFwlbQ+dSE=", "user"=>{"first_name"=>"adfs", "last_name"=>"asdffasd", "email"=>"asdfsd@email.arizona.edu", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Create User"}
WARNING: Can't mass-assign protected attributes for User: email, password, password_confirmation, first_name, last_name
 
Thats a warning..did the record went through
also give me the server log
 
10:58 PM
no
(0.1ms) BEGIN
User Exists (0.3ms) SELECT 1 AS one FROM `users` WHERE `users`.`email` = BINARY '' LIMIT 1
(0.1ms) ROLLBACK
Rendered devise/shared/_links.erb (0.5ms)
Rendered devise/registrations/new.html.erb within layouts/application (27.9ms)
Completed 200 OK in 94ms (Views: 36.4ms | ActiveRecord: 11.8ms)
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2014-02-26 15:56:52 -0700


Started GET "/assets/main.css?body=1" for 127.0.0.1 at 2014-02-26 15:56:52 -0700


Started GET "/assets/bootstrap.css?body=1" for 127.0.0.1 at 2014-02-26 15:56:52 -0700


Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2014-02-26 15:56:52 -0700


Started GET "/assets/scaffolds.css?body=1" for 127.0.0.1 at 2014-02-26 15:56:52 -0700


Started GET "/assets/conversations.css?body=1" for 127.0.0.1 at 2014-02-26 15:56:52 -0700
 
Create a new user as the user you are supplying already exists
and you are signing up for a new user
 
No, ill post the stck
Started POST "/users" for 127.0.0.1 at 2014-02-26 16:00:01 -0700
Processing by Devise::RegistrationsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"4KvHBYLTXs+wRAyB/1d5DKRVRqWO3eFKWyFwlbQ+dSE=", "user"=>{"first_name"=>"new", "last_name"=>"user", "email"=>"newuser@email.uoregon.edu", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Create User"}
WARNING: Can't mass-assign protected attributes for User: email, password, password_confirmation, first_name, last_name
 
SELECT 1 AS one FROM users WHERE users.email = BINARY ''
why BINARY..it should be "newuser@email.uoregon.edu"
 
what do i do about that?
 
Remove
validates_presence_of :first_name, :last_name, :email, :password, :password_confirmation #tried removing this due to strong params, to no avail
validates_uniqueness_of :email
validations for email,password and password_confirmation
Just keep first_name and last_name
 
11:05 PM
Only getting two errors now: Email can't be blank
Password can't be blank
 
It should be as follows
validates_presence_of :first_name, :last_name
Then run it
and share the server log
 
Log:
Started POST "/users" for 127.0.0.1 at 2014-02-26 16:06:40 -0700
Processing by Devise::RegistrationsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"4KvHBYLTXs+wRAyB/1d5DKRVRqWO3eFKWyFwlbQ+dSE=", "user"=>{"first_name"=>"new4", "last_name"=>"user4", "email"=>"newuser4@email.uoregon.edu", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Create User"}
WARNING: Can't mass-assign protected attributes for User: email, password, password_confirmation, first_name, last_name
Could the problem be in my strong params?
For my controller:
def create
@user = User.new(signup_params)
if @user.save
sign_in @user
flash[:success] = "Welcome to Bicycle!"
redirect_to @user
else
render 'new'
end
end
 
You already added them in ApplicationController
 
should i delete my strong params?
 
Your controller is not being called
 
11:08 PM
def signup_params
  params.permit(:first_name, :last_name, :email, :password, :password_confirmation)
  #.require(:user)
end
 
Method called is Devise::RegistrationsController#create
 
Oh,, its the devise dontroller, I forgot
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
should this line be different in my view??
 
Are you using protected_attributes gem
??
 
Good call!!
thank you
I don't even remember adding that gem'
 
Wait..
Did it work
?
I'll update my answer then so that you can accept it and i get the points :)
 
11:12 PM
it did, now i'm getting a bunch of other erros, that are probably unrelated
okey!!!
thanks
 
okies..
Your welcome
 

  last day (236 days later) »