Updated

How to update a model attribute in a RESTful Rails web app via a ruby script using rest-client gem.

Solution

Create the following app

rails new star
cd star
rails generate scaffold PronStar name:string action:string
rake db:migrate
rails s

install rest-client gem

gem 'rest_client'

Then assuming that you want to update a pron_star with id = 1 via a ruby script and the server is running on your pc, execute:

# update_pron_star.rb
require 'rest_client'
RestClient.put("http://127.0.0.1:3000/pron_stars/1", :pron_star => { :name => "Sexy", :action => "all" })

References

[1] rest-client