|
Project Information
Members
Featured
Downloads
Links
|
AutoRest first public release 31/10/2007Simplify the development of rest based applications by using a generic controller implementation. Based on scaffold_resource of rails 1.2.3.
With a single call of a class method, includes the default methods for a rest controller using user-supplied configuration. Smart defaults are generated for all the missing configuration parameters. AuthorEmmanuel Oga. http://EmmanuelOga.WordPress.com UsageFor a complete sample app, check the sample app in the downloads. That app should be extracted to the root of the plugin. The sample app specs covers a great deal of the functionality that would be very difficult to spec without a complete rails app. By using the ar_spec_scaffold generator, a controller with all the options ready for customize is generated.
The generator usage is the same as scaffold_resource: ruby script/generate auto_rest ResourceName [optional_field_1:type] [...] [optional_field_n:type]
The optional fields are used only to include them on the migration. This generator produces also the proper specs on RAILS_ROOT/spec folder. You can use the --skip-rspecing to skip the generation of rspec-based specs. Don't forget to:
to use rspec.
nesting of routes in mind. See http://weblog.jamisbuck.org/2007/2/5/nesting-resources So it uses routes like ActionController::Routing::Routes.draw do |map|search_opt= { :search => :get } map.resources :zones, :collection => search_opt do |zone|zone.resources :customers, :name_prefix => "zone"end map.resources :customers, :collection => search_opt end
on the collection of resources, just like i did above. Also include acts_as_ferret plugin and acts_as_ferret on the model class of the resource.
<html><head><title>AutoRest Test App</title></head>
</html>
|