roar-rails
roar-rails copied to clipboard
Rails Generators - Coder Needed!
We could need generators for creating representers in Rails. Anyone?
Usage could be like
rails g roar:representer singer name band:Band albums:collection
This API is subject to discussion, what kind of properties are common and could be handy being generated from the command line?
Examples for writing and testing generators can be found here:
- https://github.com/apotonick/cells/blob/master/test/cell_generator_test.rb
- https://github.com/apotonick/cells/blob/master/lib/generators/cells/base.rb
Do you have any example that how this representer should be?
module SingerRepresenter
include Roar::Representer::JSON # should be a switch in the generator for other formats like XML or HTML
property :name, :extend => BandRepresenter, :class => Band
collection :albumns
end
Hey @apotonick, I'm going to tackle this one, ok? I'll pull request you as soon as I have something working.
:heart:
On Mon, Jul 29, 2013 at 10:37 PM, Guilherme Cavalcanti < [email protected]> wrote:
Hey @apotonick https://github.com/apotonick, I'll tackle this one, ok? I pull request you as soon as I have something working.
— Reply to this email directly or view it on GitHubhttps://github.com/apotonick/roar-rails/issues/16#issuecomment-21716743 .
Hey @apotonick is there anything I could do to improve this feature?
Let's chat here: https://gitter.im/trailblazer/chat :heart: