1

I am following the instructions here in order to add two parameters to my sign up / registration form in a Ruby on Rails + devise based application: http://devise.plataformatec.com.br/#getting-started/strong-parameters

My controller is straight forward:

class ApplicationController < ActionController::Base
  protect_from_forgery with: :exception

  before_filter :configure_permitted_parameters, if: :devise_controller?

  before_filter :authenticate_user!

  protected

  def configure_permitted_parameters
    devise_parameter_sanitizer.for(:sign_up) << :username
  end
end

The error I'm getting is the following:

NoMethodError in Devise::SessionsController#new 

undefined method `<<' for {}:ActionController::Parameters

Am I using the wrong version of Devise or something? I have gem 'devise', :git => 'https://github.com/plataformatec/devise', :branch => 'v3.0' specified in my Gemfile, nothing else is out of the ordinary.

1 Answer 1

2

This feature requires Devise 3.1.0.rc according to an issue opened on the Devise repo.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.