ruby on rails - Why am I getting an uninitialized constant error and how can I fix it? -


when try run signup form web app i'm building in rails, following error:

uninitialized constant user::pillhq

which references 2 methods in app code, 1 in user model , 1 in user controller.

the method in question in user model is

def save_with_payment if valid? customer = stripe::customer.create(description: email, plan: pillhq, card: stripe_card_token) self.stripe_customer_token = customer.id save! end 

and method in question in user controller

def create @user = user.new(params[:user]) if @user.save_with_payment sign_in @user flash[:success] = "welcome sample app!" redirect_to edit_user_path(current_user) usermailer.welcome_email(@user).deliver else render 'new' end end 

i'm not sure how remove error, can give awesome!

the word pillhq on line below not valid against "naming conventions", assuming variable...

customer = stripe::customer.create(description: email, plan: pillhq, card: stripe_card_token) 

local variables
lowercase letter followed other characters, naming convention states better use underscores rather camelback multiple word names, e.g. mileage, variable_xyz

more information can found here.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -