lib/generators/rails/USAGE in roar-rails-1.0.0 vs lib/generators/rails/USAGE in roar-rails-1.0.1
- old
+ new
@@ -8,34 +8,34 @@
rails g representer Band id name
This will create a representer as follows:
module BandRepresenter
- include Roar::Representer::JSON
+ include Roar::JSON
property :id
property :name
end
You can pass :class and :extend property options:
- rails g singer id instrument:equipament:instrument_representer
+ rails g singer id instrument:equipment:instrument_representer
This will add property options:
module SingerRepresenter
- include Roar::Representer::JSON
+ include Roar::JSON
property :id
property :instrument, :class => Equipment, :extend => InstrumentRepresenter
end
You can also choose representer format with --format option
rails g representer Band id name --format=xml
module BandRepresenter
- include Roar::Representer::XML
+ include Roar::XML
property :id
property :name
end