Hello,
Using an external YAML file for storing static datas is cool. And doing so in a basic Rails application is easy using in config/initializers/load_config.rb such: CONFIG = YAML.load_file("#{RAILS_ROOT}/config/config.yml") ...after what datas can be called in application.rb with CONFIG['something'].
But how can we load the YAML configuration file of a plugin (in its controller for instance)? For example if my plugin is in vendor/plugins/my_plugin and its YAML file is in vendor/plugins/my_plugin/config.yml?
Well you can have your plugin's code do anything you want, including read in such a yaml file if you want.
And I have an other question about this topic: is that possible to
complet the Rails internationalization's YAML files stored in config/locales/ using a additionnal YAML file into the plugin (in order to generate dynamic flash messages for instance in plugin's controllers, like so: flash[:error] = t(there_is_an_error))?
You could try adding the appropriate folder(s) to the i18n load path.
Fred