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 7574067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:20:34+00:00 2026-05-30T16:20:34+00:00

I have an update form in Rails 3 for admin users that fails silently,

  • 0

I have an update form in Rails 3 for admin users that fails silently, despite having validations. It was working previously, but when I moved everything to a namespace, it no longer saves.

Here is the relevant code from my controller:

def update
    @admin = Admin::Admin.find(params[:id])

    respond_to do |format|
        if @admin.update_attributes(params[:admin])
            flash[:success] = "'#{@admin.name}' was successfully updated."
            format.html { redirect_to admin_admins_path }
        else
            format.html { render action: "edit" }
        end
    end
end

And the model (unfinished, but previously working):

class Admin::Admin < ActiveRecord::Base
    validates :name,   :presence=>{:message=>"Name can't be blank"}
    validates :email,   :presence=>{:message=>"Email can't be blank"},
        :length => {:minimum => 3, :maximum => 254, :message=>"Email must be between 3 and 254 characters"},
        :uniqueness=>{:message=>"Email has already been registered"},
        :format=>{:with=>/^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i, :message=>"Email must be a valid email format"}
    validates :password,   :presence=>{:message=>"Password can't be blank"}
end

And the first part of the form partial:

<%= form_for(@admin) do |f| %>

Everything loads properly, but when I try to save, my validations are ignored and it redirects to the index page with a success message, but without saving the data. I have a feeling I’m missing something to do with namespaces, but I’m not completely sure what the problem is. Could it be looking for the model in the base model directory?

  • 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-30T16:20:35+00:00Added an answer on May 30, 2026 at 4:20 pm

    Did you inspect the params? I could imagine that params[:admin] does not contain the forms values anymore.

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

Sidebar

Related Questions

I have a Rails form that allows users to update the values of a
I have an SQL query that takes the following form: UPDATE foo SET flag=true
I have a form that I am using to try and update a field
I have a basic CRUD form that uses PageMethods to update the user details,
I have a MDI container form, and some child forms that update their title
rails: I have 'create' and 'update' using the same partial '_form' but the url
I have an otherwise functioning rails project where I'm trying to update some form
I have a rails 3 form that has 100+ questions. Each time a radio
I have a form that is submitted via ajax in a rails 3 app.
I am trying to create form that contains another model in rails. I have

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.