Sha256: 2f992826b57cd7279e85a5de7495ec686c69d686fc97e330a9703e9aa80fd9b0

Contents?: true

Size: 1.37 KB

Versions: 12

Compression:

Stored size: 1.37 KB

Contents

# Migrating from Presenters v2 to COPRL Presenters v3

## Plugins

The plugins have been modified to support Rails native views.
There is a generator that you can also use to generate a new plugin: `coprl generate plugin PLUGIN_NAME`.
In some cases generating a new plugin and moving over the code may be the preferred option.

The rest of this guide assumes you are going to migrate it over manualy.

### Module Rename
* Rename library directory `lib/voom` => 'lib/coprl'
* Refactor module `Voom` => `Coprl`
* Replace in `lib` files  'voom/' => `coprl/`

### View Changes

In the Coprl::Presenters::Plugins::PLUGIN_NAME::WebClientComponents
Add the following callback that points to your views directory

    def view_dir_PLUGIN_NAME(pom)
        File.join(__dir__, '../../../../../../..', 'views', 'components')
    end

* Add an `application` directory under your view directory returned above.
* Add a `_` prefix to your templates.
* Change erb render calls in your templates `erb :"components/event"` => `partial "components/event"`
* Add raw calls to any javascript/css that you emitt from your templates, e.g., `<%= raw File.read(File.expand_path('../../../../../../public/c3.min.css', __dir__)  ) %>`

**Recommended** 

Move templates, javascript and css files into their own view directory at the root of the presenter. 
This makes it easier to reason and find the appropriate parts of the plugin

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
coprl-3.0.0.beta.12 docs/migrating_from_v2_to_v3.md
coprl-3.0.0.beta.11 docs/migrating_from_v2_to_v3.md
coprl-3.0.0.beta.10 docs/migrating_from_v2_to_v3.md
coprl-3.0.0.beta.9 docs/migrating_from_v2_to_v3.md
coprl-3.0.0.beta.8 docs/migrating_from_v2_to_v3.md
coprl-3.0.0.beta.7 docs/migrating_from_v2_to_v3.md
coprl-3.0.0.beta.6 docs/migrating_from_v2_to_v3.md
coprl-3.0.0.beta.5 docs/migrating_from_v2_to_v3.md
coprl-3.0.0.beta.4 docs/migrating_from_v2_to_v3.md
coprl-3.0.0.beta.3 docs/migrating_from_v2_to_v3.md
coprl-3.0.0.beta.2 docs/migrating_from_v2_to_v3.md
coprl-3.0.0.beta.1 docs/migrating_from_v2_to_v3.md