Displaying 2 results from an estimated 2 matches for "observation_type".
2007 Dec 13
1
How to set response code
Hi !
I''m trying to return a simple 201 Created status to the caller, but I
can''t seem to do it. I use curl from the command line with the
--verbose option, and the response is really 200 OK.
My controller code:
class Observations < Application
def create(feature, node, observation_type)
# Do some work...
response.status = "201 Created"
""
end
end
And the curl output:
$ curl -v http://localhost:4000/observations -d feature=www -d
node=andromede -d observation_type=mem:used -d value=632243
* About to connect() to localhost port 4000 (#0)
*...
2007 Dec 13
2
Trying to use ActiveRecord STI but fails
...es.rb;
2. I have a file named app/models/measurement.rb which looks like this:
class Measurement < Observation
end
3. I have another file named app/models/observation.rb which looks like
this:
class Observation < ActiveRecord::Base
belongs_to :feature
belongs_to :node
belongs_to :observation_type
end
4. I ran rake freeze_from_svn
5. I start merb using script/merb and stdout/stderr look like this:
$ script/merb
Merb started with these options:
---
:exception_details: true
:reloader: true
:session_secret_key: .6393
:mongrel_x_sendfile: true
:reloader_time: 0.5
:cache_templates: false
:merb_...