title: NoMethodError in Devise::RegistrationsController#create undefined method 'sanitize'
body: <p>I am quite new to rails and would appreciate any help. I am unable to have my users sign up using devise and am getting:</p>
  
  <p>NoMethodError in Devise::RegistrationsController#create
  undefined method `sanitize' for #</p>
  
  <p>based on my registrations_controller:</p>
  
  <pre><code>  def create
      build_resource(sign_up_params)
  
    def sign_up_params
      devise_parameter_sanitizer.sanitize(:sign_up)
    end
  </code></pre>
  
  <p>I used devise_parameter_sanitizer.for(:sign_up) instead of devise_parameter_sanitizer.sanitize(:sign_up) as suggested by  MrYoshiji and this worked but then I got undefined method is_flashing_format?'. I changed that to 'is_navigational_format?' and it worked and now I'm getting undefined method expire_data_after_sign_in!'. So I keep getting undefined methods. I'm thinking this may be due to the fact that I removed the protected attributes gem because my omniauth for facebook and linkedin would not work unless I did so.  How would I go about fixing this?</p>
  
  <p>My applications controller looks like this:</p>
  
  <pre><code>class ApplicationController &lt; ActionController::Base
   before_filter :configure_permitted_parameters, if: :devise_controller?
   protected
  
    def configure_permitted_parameters
      devise_parameter_sanitizer.for(:sign_up) do |u|
          u.permit(:image, :first_name, :last_name, :address, :city, :state_province, :country, :password, :password_confirmation, :email, :position, :credentials, :headline, :description, :location_photo, :portfolio_photo, :study_style, :current_password)
      end
      devise_parameter_sanitizer.for(:account_update) do |u|
          u.permit(:image, :first_name, :last_name, :address, :city, :state_province, :country, :password, :password_confirmation, :email, :position, :credentials, :headline, :description, :location_photo, :portfolio_photo, :study_style, :current_password)
      end
     end
  
   def ensure_signup_complete
      # Ensure we don't go into an infinite loop
      return if action_name == 'finish_signup'
  
      # Redirect to the 'finish_signup' page if the user
      # email hasn't been verified yet
      if current_user &amp;&amp; !current_user.email_verified?
        redirect_to finish_signup_path(current_user)
      end
    end
  
  
    # Prevent CSRF attacks by raising an exception.
    # For APIs, you may want to use :null_session instead.
    protect_from_forgery with: :exception
  
    private
    def not_authenticated
      redirect_to login_url, alert: "Please login to access this page"
    end
  end
  </code></pre>
  
  <p>gemfile is like so:</p>
  
  <pre><code>source 'https://rubygems.org'
  ruby '2.1.3'
  
  gem 'byebug', '~&gt; 3.5.1'
  gem 'rails', '4.0.3'
  gem 'pg'
  gem 'bootstrap-sass', '~&gt; 3.1.1'
  gem 'faker'
  gem 'geocoder'
  gem 'carrierwave'
  gem 'mini_magick'
  gem 'figaro'
  gem 'state_machine'
  gem 'jquery-ui-rails', '~&gt; 4.2.1'
  gem 'rails_12factor'
  gem 'elasticsearch-model'
  gem 'simple_form'
  gem 'omniauth-facebook'
  gem 'omniauth-linkedin'
  gem 'omniauth'
  gem 'pry-rails'
  gem 'sidekiq'
  gem 'will_paginate', '~&gt; 3.0.6'
  gem 'will_paginate-bootstrap'
  gem "js-routes"
  gem "mailchimp-api", require: 'mailchimp'
  gem 'sass-rails', '~&gt; 4.0.0'
  gem 'uglifier', '&gt;= 1.3.0'
  gem 'coffee-rails', '~&gt; 4.0.0'
  gem 'jquery-rails'
  gem 'jquery-fileupload-rails'
  gem 'jbuilder', '~&gt; 1.2'
  gem 'devise', '3.0.0.rc'
  gem 'rails_12factor'
  
  
  
  group :development, :test do
    gem 'rspec-rails', '2.13.1'
    gem 'quiet_assets'
    # gem 'pry-debugger'
    gem 'meta_request'
    gem 'interactive_editor'
    gem 'hirb'
    gem 'awesome_print'
    gem 'selenium-webdriver', '2.35.1'
    gem 'capybara', '2.1.0'
    gem 'factory_girl_rails', '4.2.1'
  end
  #
  group :production do
  
  end
  
  group :doc do
  
    gem 'sdoc', require: false
  end
  </code></pre>
  
  <p>My users controller looks like this:</p>
  
  <pre><code>class UsersController &lt; ApplicationController
    skip_before_filter :authenticate_user!, only: [:index,:new,:create,:activate]
    before_filter :authenticate_user!, only: [:edit,:update,:destroy]
    before_filter :admin_user, only: :destroy
    before_action :set_user, only: [:show, :edit, :update, :destroy]
    before_action :find_user, only: [:infowindow, :edit_meetup_info, :finish_signup]
    # respond_to :json, :html
  
    def new
      @user = User.new
    end
  
    def create
      @user = User.new(user_params)
      if @user.save
        flash[:success] = "Thank you for signing up! A confirmation email has been sent to your inbox"
        redirect_to users_path
      else
        render :new
      end
    end
  
  
    def edit
    @user = User.find(current_user.id)
    successfully_updated = if needs_password?(@user, params)
        @user.update_with_password(devise_parameter_sanitizer.sanitize(:account_update))
      else
        # remove the virtual current_password attribute
        # update_without_password doesn't know how to ignore it
        params[:user].delete(:current_password)
        @user.update_without_password(devise_parameter_sanitizer.sanitize(:account_update))
      end
  
      if successfully_updated
        set_flash_message :notice, :updated
        # Sign in the user bypassing validation in case their password changed
        sign_in @user, :bypass =&gt; true
        redirect_to after_update_path_for(@user)
      else
        render "edit"
      end
    end
  
  
  
    def update
      # authorize! :update, @user
      respond_to do |format|
        if @user.update(user_params)
          sign_in(@user == current_user ? @user : current_user, :bypass =&gt; true)
          format.html { redirect_to @user, notice: 'Your profile was successfully updated.' }
          format.json { head :no_content }
        else
          format.html { render action: 'edit' }
          format.json { render json: @user.errors, status: :unprocessable_entity }
        end
      end
    end
  
      def finish_signup
      # authorize! :update, @user 
      if request.patch? &amp;&amp; params[:user] #&amp;&amp; params[:user][:email]
        if @user.update(user_params)
          @user.skip_reconfirmation!
          sign_in(@user, :bypass =&gt; true)
          redirect_to @user, notice: 'Your profile was successfully updated.'
        else
          @show_errors = true
        end
      end
    end
  
    def destroy
      # authorize! :delete, @user
      @user.destroy
      respond_to do |format|
        format.html { redirect_to root_url }
        format.json { head :no_content }
      end
    end
  
    def activate
      if (@user = User.load_from_activation_token(params[:id]))
        @user.activate!
        redirect_to(login_path, :info =&gt; 'User was successfully activated.')
      else
        not_authenticated
      end
    end
  
    def infowindow
      respond_to do |format|
        format.html {render partial: "infowindow", locals: {user: @user}}
      end
    end
  
    def tooltip
      respond_to do |format|
        format.html {render partial: "tooltip"}
      end
    end
  
    def edit_meetup_info
      @user = User.find(params[:id])   
    end
  
    def available
      # accept a params[:date]
      # user.available?(params[:date]) =&gt; true / false
    end
  
    private
      def set_user
        @user = User.find(params[:id])
      end
  
      def user_params
        accessible = [ :user_id, :first_name, :last_name, :email, :password, :password_confirmation, :gender, :address, :city, :state_province, :image, :country, :meetup_location_available, :current_online_learning, :languages, :location_photo, :portfolio_photo, :position, :meetup_location_available, :accommodates, :expertise ] # extend with your own params
        accessible &lt;&lt; [ :password, :password_confirmation ] unless params[:user][:password].blank?
        params.require(:user).permit(:user_id, :first_name, :last_name, :email, :gender, :password, :password_confirmation, :address, :city, :state_province, :image, :country, :meetup_location_available, :current_online_learning, :languages,  :location_photo, :portfolio_photo, :position, :meetup_location_available, :accommodates, :expertise)
      end
  
      def find_user
        @user = User.find(params[:id])
      end
  
      def admin_user
        redirect_to root_url unless current_user.admin?
      end
    end
  </code></pre>
  
  <p>Thanks for helping</p>