mardi 19 avril 2016

Command Line hash input

I have a generator class that I can run like this:

rails g shopping_template --attributes=email:hello

It recognizes email as input. But when I want to add several attributes its not working, it only recognizes email:

rails g shopping_template --attributes=email:hello,name:hans,house:big

Ho do I have to change --attributes=email:hello,name:hans,house:big so that its recognized correctly as a hash?

Here's the code from the class:

class_option :attributes,
             type: :hash,
             default: {}

Aucun commentaire:

Enregistrer un commentaire