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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:32:48+00:00 2026-05-25T19:32:48+00:00

I have been trying to implement Ryan Bates Railscast 198 into rails 3 for

  • 0

I have been trying to implement Ryan Bates Railscast 198 into rails 3 for like 4 days… at least at night if you know what I mean. Anyway, here is the code I have right now:

User controller actions (Devise setup to show the different states of approved):

def index
  if params[:approved] == "false"
    @users = User.find_all_by_approved(false)
  elsif
    @users = User.find_all_by_approved(true)
  else
    @users = User.all
  end
end

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

  respond_to do |format|
    if @user.update_attributes(params[:user])
      format.html { redirect_to root_path flash[:notice] = "User was successfully updated." }
    else
      format.html { render :action => "edit" }
    end
  end
end

def edit_individual
  @users = User.find(params[:user_ids])
end

def update_individual
  @users = User.update(params[:users].keys, params[:users].values).reject { |p| p.errors.empty? }
    if @users.empty?
      flash[:notice] = "Users updated"
      redirect_to users_url
    else
      render :action => "edit_individual"
    end
  end 
end

My User#index

<h1> Users</h1>

 <%= link_to "All Users", :action => "index" %> |
 <%= link_to "Users awaiting approval", :action => "index", :approved => "false"%>
 |
 <%= link_to "Approved Users", :action => "index", :approved => "true" %>

 <%= form_tag edit_individual_users_path, :method => :put do  %>
 <table>
   <tr>
    <th>Email Address</th>
    <th>Approved</th>
    <th></th>
   </tr>

<% for user in @users %>
 <tr>
   <td> <%= user.email %></td>
   <td><%= check_box_tag user.id %></td>
   <td> <%= link_to "Edit", edit_user_path(user) %></td>
</tr>
<% end %>

<p><%= submit_tag "Edit Checked" %></p>
  </table>

<% end %>

And the User#edit_individual

<%= form_tag update_individual_users_path, :method => :put do %>
<% for user in @users %>
<%= fields_for "users[]", user do |f| %>
  <h2><%=h user.name %></h2>
  <p><%= check_box_tag user.id %></p>
<% end %>
<% end %>
<p><%= submit_tag "Submit" %></p>

<% end %>

routes.rb

devise_for :users
  resources :users do
    collection do 
      post :edit_individual
      put :update_individual
    end
  end 
end

So I handled the basic by googling: fields_for needs an “=” stuff like that. #index shows fine but if I check a checkbox and then hit the edit checked button I get the following error:

ActiveRecord::RecordNotFound in UsersController#update

Couldn't find User with id=edit_individual

Any ideas??? thanks so much

  • 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-25T19:32:48+00:00Added an answer on May 25, 2026 at 7:32 pm

    Please check your routes.rb and controller code, as it’s quite a bit off from the code on Railscast 198’s page: http://railscasts.com/episodes/198-edit-multiple-individually

    It’s best to just copy it in if you’re new to rails and adjust for using users instead of products. Then go through it to try to understand what it does.

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

Sidebar

Related Questions

I have been trying to implement the delete BST function but I don't know
I have been trying to implement the camera into my application following this tutorial
I have been trying to implement Win32's MessageBox using GTK. The app uses SDL/OpenGL,
I've been trying to implement unit testing and currently have some code that does
I have been trying to implement a CheckBox Node Tree, where the parent nodes
I have been trying to implement hash-tables using uthash.h, following the (excellent) documentation I
I have been trying to implement Nhibernate.Linq 1.0.0.4000 together with Nhibernate 2.1.2.4000. After what
OK. So I have been trying to implement a timer. Now a very weird
I am a beginner interested in Haskell, and I have been trying to implement
I have been trying to implement 2 Seperate Contact Modals based off an original

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.