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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:55:35+00:00 2026-05-11T05:55:35+00:00

I am using the make_resourceful plugin in my Rails app, and attempting to use

  • 0

I am using the make_resourceful plugin in my Rails app, and attempting to use nested resources.

My controller code looks like this:

class ClientRegionsController < ApplicationController   make_resourceful do     actions :all     belongs_to :client      response_for(:create) do |format|       format.html { redirect_to client_client_regions_path }     end      response_for(:update) do |format|       format.html { redirect_to client_client_regions_path }     end   end    private    def current_objects     @current_objects ||= ClientRegion.paginate(:page => params[:page], :order => 'name')   end end 

What I want to get on the index action is all the client_regions for a given client, i.e:

  client_1.client_regions 

What I am actually getting is all the client regions in the system, i.e.:

ClientRegion.all 

I’ve been scratching my head at this for a while, so I thought I’d ask here.

The weird thing is the other actions work as I expect, it is just the index action that is faulty.

Edit: my routes are defined as

map.resources :clients, :has_many => :client_regions 

So the paths are

/clients/1/client_regions /clients/1/client_regions/new /clients/1/client_regions/20/edit 

etc

  • 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. 2026-05-11T05:55:36+00:00Added an answer on May 11, 2026 at 5:55 am

    Ok – I fixed this myself.

    I left some code out of the question to simplify it, but that was the source of the problem. (Have edited the question to put it back in)

    The fix was to change the current_objects method to

    def current_objects     @current_objects ||= @client.client_regions.paginate(:page => params[:page], :order => 'name') end 

    Quite obvious really in hindsight…

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

Sidebar

Related Questions

I am using make and I'd like to reference a shell variable within sed.
I have a project containing C/C++ files. I'd like to build it without using
Does using namespaces make a site faster or slower? That's what I would like
I'm using the make-maven-plugin to build a software written in C with Maven. My
I m trying to modify some C++ files in ns2 and then recompile using
I am using open source C++ library DCMTK from http://dicom.offis.de/dcmtk.php.en . I have successfully
Using GNU Make I want to remove values from a variable: VAR := x.c
I am new to using GNU make. I have a makefile as below: CFLAGS
There is a pair pair <string, int> myPair; I have a vector of myPair
I am new to programming. I am creating a small word jumble game 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.