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

  • Home
  • SEARCH
  • 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 741015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:35:01+00:00 2026-05-14T08:35:01+00:00

I have implemented Authlogic. I believe that this isn’t an authlogic specific quesetion. Assume

  • 0

I have implemented Authlogic. I believe that this isn’t an authlogic specific quesetion. Assume that I have a User model and each User has a column in the database called “login”.

Upon creating a user, the login column is populated. However, I don’t want the user to be able to change their login once they set it.

Currently, I have removed the text field in the _form.html.erb file in my views for users. However, it can probably still be accessed through the url right?

How can I make it so that once a login is set, it can not be changed at all?

  • 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-05-14T08:35:01+00:00Added an answer on May 14, 2026 at 8:35 am

    As far as I know, Authlogic handles this case for you so you don’t have to worry about someone overwriting their username. To handle that type of case in general, you can set the username as a protected attribute by excluding it from the attr_accessible attributes in the model, and assigning it directly in the UserController’s create action, which gets around the mass assignment protection in the single case where you do want to set it. For example:

    class User < ActiveRecord::Base
      attr_accessible :email, :password, :other_field1, :other_field2 # note username is not listed
    end
    
    class UserController < AppController
      def create
        @user = User.new(params[:user])
        @user.username = params[:user][:username]
        @user.save
        # ...
      end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Rails 2.3.x app that implements the act_as_authentic in User model and
I have implemented a sort of Repository class and it has has GetByID ,
I have implemented a simple appmod that handle WebSockets and echo back the messages.
I have implemented vibration using vibrator .In my application, when the user press the
We have implemented a drag and drop feature that shows a nice simple representation
I have implemented my own VirtualPathProvider for loading 'embedded' views. This works very well
I have implemented a simple file upload-download mechanism. When a user clicks a file
I have implemented a python webserver. Each http request spawns a new thread. I
I have implemented a function to validate .edu domains. This is how I am
I have implemented an ASP.NET http handler. It appears to me that there is

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.