|
Project Information
Members
Links
|
ActiveResource is wicked spiffy, but the reality is that the most obvious use cases all blow up like kaboom. You can't do find(:include), you can't use form handlers without a little bit of meta and a whole lotta luck, and you can't just save an ActiveResource model across the network with all its association classes... Until now. Snazzy Resource is a Rails plugin that allows an ActiveRecord model to instantiate and save itself - the equivalent of a create or create! - from the params you'll automatically receive by default from any ActiveResource model saving itself via PUT which happens to contain association classes. All you have to do in your receiving-end controller is: MyModel.create_from_active_resource(params[:my_model]) Save as normal from your ARes client: MyModel.new({"attribute" => "data"}).save And all the other magic happens for you. (All the other saving-across-the-network magic, that is. The other two, stay tuned.) |