RYS Generator
In this article you will learn how the RYS Generator works.
What is the RYS Generator?
The RYS generator is our product and is primarily for creating a new RYS into the EasySoftware platform. When creating a new RYS using a generator, a new bare-bone rails engine structure is created.
Plugin
The target directory is evaluated in this order:
--pathoptionsRYS_PLUGINS_PATHenvironment variableRAILS_ROOT/rys_plugins
Gem is also added into Gemfile.local
Patches
rails generate rys:patch TYPE PLUGIN NAME
rails generate rys:patch m RYS_PLUGIN_NAME Issue
rails generate rys:patch model RYS_PLUGIN_NAME Issue
rails generate rys:patch helper RYS_PLUGIN_NAME Issues
Or you can use interactive generator:
Rails generators
You can use the same generator like in any Rails plugin. Just add prefix rys and specify Rys plugin name.
rails generate rys:model RYS_PLUGIN_NAME ...normal arguments...
rails generate rys:scaffold RYS_PLUGIN_NAME ...normal arguments...
rails generate rys:controller RYS_PLUGIN_NAME ...normal arguments...
Entity Generator
To generate new entity into RYS you can use our Entity Generator
By default it generate whole CRUD, includes views with builder form, guessed fields and EasyQuery. It generate also custom field class and basic tests.
You can install it by running
or
gem 'easy_entity_generator', git: '[email protected]:rysy/features/easy_entity_generator.git', branch: 'master'
When you are done you can finally use the generator, by
- generating new entity
Possible options are: --project --author --acts_as_customizable --acts_as_searchable --acts_as_activity_provider --acts_as_attachable --acts_as_event --acts_as_tree --acts_as_watchable note: --author is default. If you want to skip it, use --no-author.
Example:
- Reverting generated entity
Example: