rest - Rails - make_resourceful with nested resources -


I am using a plugin in my Rail App and am trying to use nested resources.

My control code looks like this:

  class client rule controller & lt; ApplicationController make_resourceful do verbs: all related_to: Create client feedback (for). Format | Format.html {redirect_to client_client_regions_path} End Response_ (For: Update). Format | Format.html {redirect_to client_client_regions_path} End end personal def current_objects @current_objects || = ClientRegion.paginate (: page => parameter [: page],: command = & gt; "name") end  

What do I get in index action, All Client_Regions are for the customer, that is:

  client_1.client_regions  

What exactly is happening in the system are all client zones in the system, that is: < / P>

  ClientRegion.all  

I'm scratching my head for a while, so I thought I would ask here.

The strange thing is that the other actions work as I would expect, this is just an index action which is defective.

Edit: My route is defined as

  map.resources: the client, has_many = & gt; : Clients_regitions  

are paths

  / clients / 1 / client_regions / clients / 1 / client_regions / new / clients / 1 / client_regions / 20 / < OK - I have decided it myself. I have decided it myself. 

I left some code in question to simplify it, but this was the source of the problem. (Has edited the question to keep it back)

The method of existing objects

  DRF current_objects @ cert_objects || = @ Client.client_regents.paginate was changed to <: 

/ html>

Comments