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 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 trying to compile my piece of code using make. Normally I compile
I have a C++ small project using GNU Make. I'd like to be able
Here's the code I'm using to make a custom AlertDialog. public void onButtonClicked(View v)
I would like to know what guys are using to make diagram of your
I'ld like to automatically detect (using #ifdef) whether I'm building using XCode or using
So I'm trying to build GotoBLAS2 for use in WIEN2k, and after using make,
this is a bit related to this question . I'm using make to extract
I'm using std::make_pair() for this example because pretty much any C++ programmer ought to
Is it possible to use spaces in ddply? I'm using data from a spreadsheet
I'm using make in Windows and I'd like to read a couple of values

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.