roar-rails icon indicating copy to clipboard operation
roar-rails copied to clipboard

Rails Generators - Coder Needed!

Open apotonick opened this issue 13 years ago • 6 comments

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

apotonick avatar Jun 20 '12 08:06 apotonick

Do you have any example that how this representer should be?

lucasallan avatar Jun 20 '12 12:06 lucasallan

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

apotonick avatar Jun 21 '12 11:06 apotonick

Hey @apotonick, I'm going to tackle this one, ok? I'll pull request you as soon as I have something working.

guiocavalcanti avatar Jul 29 '13 12:07 guiocavalcanti

: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 .

apotonick avatar Jul 29 '13 13:07 apotonick

Hey @apotonick is there anything I could do to improve this feature?

guiocavalcanti avatar Nov 16 '15 13:11 guiocavalcanti

Let's chat here: https://gitter.im/trailblazer/chat :heart:

apotonick avatar Nov 16 '15 23:11 apotonick