I am designing a REST api for one of my applications & considering using RoR for the same and had a few questions that I was wondering if Rails can support before I can decide on RoR -
1) does rails support setting HTTP response code status. So I want something like this
if customer_save_fail
response.status_code = 500
end
2) in rails is there a way to execute straight up SQL statement, i want this for complex queries & dont want to use ActiveRecord. I am guessing I can use DBI gem for this? Is there any other way? that integrates with Rails. Also I need a way to convert the resultsets returned by straight queries into JSON, something like to_json. Can I achieve something like this with RoR out of the box?
Thanks all for your inputs.