ActiveResource with nested relation fails with routing error <p>I am newbie to the rails world and in my project we have following model on server side </p> <pre><code> class Server &lt; ActiveRecord::Base has_many :disks, :dependent =&gt; :destroy accepts_nested_attributes_for :disks, :reject_if =&gt; lambda { |a| a[:size].blank? }, :allow_destroy =&gt; true end class ServersController &lt; ApplicationController def new @server = Server.new 4.times { @server.disks.build } respond_to do |format| format.xml { render :xml =&gt; @server.to_xml(:include =&gt; :disks) } format.json { render :json =&gt; @server.to_json(:include =&gt; :disks) } end end end </code></pre> <p>and </p> <pre><code>class Disk &lt; ActiveRecord::Base belongs_to :server validates :size, presence: true end </code></pre> <p>On Client Side we have </p> <pre><code>class Server &lt; ActiveResource::Base self.site = URLS_CONFIG['server_url'] self.format = :json self.include_root_in_json = true end </code></pre> <p>and </p> <pre><code>class Disk &lt; ActiveResource::Base self.site = URLS_CONFIG['server_url'] self.prefix = "/servers/:server_id/" self.format = :json end </code></pre> <p>When I try </p> <pre><code>disk1 = @server.disks.build </code></pre> <p>On client side it gave error </p> <pre><code>ActiveResource::ResourceNotFound: Failed. Response code = 404. Response message = Not Found. from /usr/local/bundle/gems/activeresource-4.0.0/lib/active_resource/connection.rb:144:in `handle_response' from /usr/local/bundle/gems/activeresource-4.0.0/lib/active_resource/connection.rb:123:in `request' </code></pre> <p>When I checked on server side the error was </p> <pre><code>ActionController::RoutingError (No route matches [GET] "/servers/disks/new.json"): 11:21:06 web.1 | actionpack (4.2.2) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call' 11:21:06 web.1 | web-console (2.1.3) lib/web_console/middleware.rb:29:in `call' 11:21:06 web.1 | actionpack (4.2.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' 11:21:06 web.1 | railties (4.2.2) lib/rails/rack/logger.rb:38:in `call_app' 11:21:06 web.1 | railties (4.2.2) lib/rails/rack/logger.rb:22:in `call </code></pre> <p>Can anyone tell me what went wrong here ? I wanted to show all disks for the server on the front end and allow user to edit and update it.</p>