Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8985309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:18:08+00:00 2026-06-15T21:18:08+00:00

So, i have model User class User < ActiveRecord::Base devise :database_authenticatable, :registerable, :recoverable, :rememberable,

  • 0

So, i have model User

class User < ActiveRecord::Base
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable

  attr_accessible :email, :password, :password_confirmation, :remember_me
end

I’ve created scaffold to that model using rails generators, in controller i added following lines:

class UsersController < ApplicationController
  before_filter :authenticate_user!

  skip_before_filter :require_no_authentication, :only => [:create]

  # ...
end

Finally, when I’m trying to create user I’ve got this:

Started POST "/users" for 127.0.0.1 at 2012-12-13 22:33:34 +0100
Processing by Devise::RegistrationsController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"wkJ8ZxVUg9eaFiL+Guu+QIfjGiwGANReiv2bTu3YQPg=", "user"=>{"email"=>"test@test.pl", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Save"}
  User Load (0.3ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
Redirected to http://localhost:3000/
Filter chain halted as :require_no_authentication rendered or redirected
Completed 302 Found in 2ms (ActiveRecord: 0.3ms)

So, according to log skip_before_filter didn’t work. What am I doing wrong?


EDIT: I don’t want give possibility to create user when someone isn’t logged in, so skipping :authenticate_user! isn’t option. btw. registerable is only temporary in User model.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T21:18:09+00:00Added an answer on June 15, 2026 at 9:18 pm

    You need to apply the changes to the right controller, in this case Devise::RegistrationsController. Simply extend it like this (not tested, but the principle should work):

    # app/controllers/registration_controller.rb
    class RegistrationsController < Devise::RegistrationsController
      skip_before_filter :require_no_authentication, :only => [:create]
    end
    

    and make sure Devise uses that:

    # routes.rb
    devise_for :users, :controllers => { :registrations => "registrations" }
    

    You can search the excellent Devise Wiki for many examples on extending Devise’s controllers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First here's my current setup: models/user.rb class User < ActiveRecord::Base devise :database_authenticatable, :registerable, :recoverable,
Lets say we have some basic AR model. class User < ActiveRecord::Base attr_accessible :firstname,
i have a model class User < ActiveRecord::Base # Include default devise modules. Others
I have a simple model like this: class User < ActiveRecord::Base serialize :preferences end
I have two models: User (email:string) Profile (name:string) class User < ActiveRecord::Base has_one :profile
I have a simple model: class User < ActiveRecord::Base has_and_belongs_to_many :roles end class Role
I have 3 model class User < ActiveRecord::Base has_many :profiles has_many :companies, :through =>
I have a User model: class User < ActiveRecord::Base has_many :cards end and a
I have a Post model: class Post < ActiveRecord::Base attr_accessible :title, :content, :tag_names belongs_to
I have a Post model: class Post < ActiveRecord::Base attr_accessible :title, :content, :tag_names belongs_to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.