Building a webservice with ruby on rails

Hi, i'm new in this forum.

I need build a web service with ruby on rails, but i don't found a
example that works. Somebody can help me with this?

Thanks!

Have you tried this?

http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/

Thank you so much, works!

Examples with authentication

http://www.justinbritten.com/work/2009/05/rails-api-authentication-using-restful-authentication/

http://www.whatcodecraves.com/articles/2008/11/25/how_to_make_an_api_for_a_rails_app/