Hi,

I have a rails server running. I wanted to connect to this using
activeresource.

Executing this code
Class Buildclient < ActiveResource::Base
self.site = "http://localhost:3000/builds"
end

builds = Buildclient.find(:all)
puts builds (## printed nil)

On the rails server terminal i see

Started GET "/builds/buildclients.json" for 127.0.0.1 at Fri Jun 15
10:34:05 -0700 2012
Processing by BuildsController#show as JSON
Parameters: {"id"=>"buildclients"}
build Load (0.2ms) SELECT `builds`.* FROM `builds` WHERE
`builds`.`id` = 0 LIMIT 1
Completed 500 Internal Server Error in 1ms

ActiveRecord::RecordNotFound (Couldn't find Build with id=buildclients):
app/controllers/builds_controller.rb:17:in `show'

Why did the parameters id=>buildclients go? And why did i get an 500
internal server error.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • Hassan Schroeder at Jun 16, 2012 at 2:47 pm

    On Fri, Jun 15, 2012 at 10:48 AM, cyber c. wrote:

    Started GET "/builds/buildclients.json" for 127.0.0.1 at Fri Jun 15
    10:34:05 -0700 2012
    Processing by BuildsController#show as JSON
    Parameters: {"id"=>"buildclients"}
    build Load (0.2ms)  SELECT `builds`.* FROM `builds` WHERE
    `builds`.`id` = 0 LIMIT 1
    Completed 500 Internal Server Error in 1ms

    ActiveRecord::RecordNotFound (Couldn't find Build with id=buildclients):
    app/controllers/builds_controller.rb:17:in `show'

    Why did the parameters id=>buildclients go?  And why did i get an 500
    internal server error.
    Your request doesn't match your app's routing. Look at the output
    of `rake routes` and compare to how you're making the request.

    Maybe re-reading <http://guides.rubyonrails.org/routing.html> will
    help clarify...

    --
    Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
    http://about.me/hassanschroeder
    twitter: @hassan

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedJun 15, '12 at 5:49p
activeJun 16, '12 at 2:47p
posts2
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Hassan Schroeder: 1 post Cyber c.: 1 post

People

Translate

site design / logo © 2021 Grokbase