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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:14:17+00:00 2026-05-18T21:14:17+00:00

i get the following when i click update after unchecking the full time box.

  • 0

i get the following when i click update after unchecking the full time box. If i Comment out the check box it doesn’t happen, but if i replace with a radio button same thing.

NoMethodError in Users#update

Showing app/views/users/_form.erb where line #26 raised:

You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.map

Extracted source (around line #26):

23:   <p>
24:     <%= form.label :manager %>
25:     <%#= collection_select( :user , :manager_id, @managers, :id, :full_name, {},{}) %>
26:     <%= form.collection_select(:manager_id, @managers, :id, :full_name, {},{}) %>
27:   </p>
28:   <p>
29:     <%= form.label :groups %>

the full source

template:

<% form_for @user, :url => user_path(@user) do |f| %>
  <%= f.error_messages %>
  <%= render :partial => "form", :object => f %>
  <%= f.submit "Update" %>
<% end %>

partial:

   <p>
    <%= form.label :login %><br />
    <%= form.text_field :login %>
  </p>
  <p>
    <%= form.label :first_name %><br />
    <%= form.text_field :first_name %>
  </p>
  <p>
    <%= form.label :last_name %><br />
    <%= form.text_field :last_name %>
  </p>
  <p>
    <%= form.label :rate %><br />
    <%= form.text_field :rate %>
  </p>
  <p>
    <%= form.label :full_time %><br />
    <%= form.check_box :full_time %>
  </p>
  <p>
    <%= form.label :manager %>
    <%#= collection_select( :user , :manager_id, @managers, :id, :full_name, {},{}) %>
    <%= form.collection_select(:manager_id, @managers, :id, :full_name, {},{}) %>
  </p>
  <p>
    <%= form.label :groups %>
    <%= form.collection_select(:group_ids, @groups, :id, :name, {}, {:multiple => true, :size => 15}) %>
  </p>

and then my controller

 def update
    @user = User.find(params[:id])

    respond_to do |format|
      if @user.update_attributes(params[:user])
        flash[:notice] = 'User was successfully updated.'
        format.html { redirect_to(@user) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @user.errors, :status => :unprocessable_entity }
      end
    end



end

  def new
    @user = User.new
    @managers = Group.find_by_name('management').users
    @groups = Group.all

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @user }
    end


 end

  # GET /users/1/edit
  def edit
    @user = User.find(params[:id])
    @managers = Group.find_by_name('management').users
    @groups = Group.all
  end
  • 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-18T21:14:18+00:00Added an answer on May 18, 2026 at 9:14 pm

    had to do with validation at the model level on the full_time attribute

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

Sidebar

Related Questions

I have the following code making a GET request on a URL: $('#searchButton').click(function() {
Why do I get following error when trying to start a ruby on rails
When I process a cube in Visual Studio 2005 I get following message: Process
We get the following error; The request was aborted: Could not create SSL/TLS secure
I get the following error when running my Visual Studio 2008 ASP.NET project (start
I get the following error when building my Windows Forms solution: LC.exe exited with
I get the following error when trying to run the latest Cygwin version of
I get the following error when attempting to install RubyGems . I've tried Googling
I get the following error pretty regularly when compiling in Visual Studio and running
I get the following error message in SQL Server 2005: User '<username>' does not

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.