|
1 |
| -# Installation guide |
| 1 | +# Installation/Update guide |
2 | 2 |
|
3 |
| -This guide shows you how to add the `matestack-ui-core` gem to an existing Rails application. |
| 3 | +This guide shows you how to add the `matestack-ui-core` gem to an existing Rails application and update it. |
4 | 4 |
|
5 | 5 | ## Installation
|
6 | 6 |
|
7 | 7 | Add 'matestack-ui-core' to your Gemfile
|
8 | 8 |
|
9 | 9 | ```ruby
|
10 |
| -gem 'matestack-ui-core', '~> 1.2' |
| 10 | +gem 'matestack-ui-core', '~> 1.3' |
11 | 11 | ```
|
12 | 12 |
|
13 | 13 | and run
|
|
44 | 44 | Now, you are able to create UI components in pure Ruby and use them in your Rails views. Additionally you can substitute Rails views and layouts with Matestack pages and apps.
|
45 | 45 |
|
46 | 46 | If you want to use Matestack's optional reactivity features in pure Ruby (through dynamic Vue.js components such as `form` and `async` or dynamic page transitions), please follow this [guide](/docs/reactive_components/100-rails_integration/) to set up the JavaScript parts via AssetPipeline or Webpacker.
|
| 47 | + |
| 48 | +## Update |
| 49 | + |
| 50 | +### Ruby Gem |
| 51 | + |
| 52 | +Depending on the entry in your Gemfile, you might need to adjust the allowed version ranges in order to update the Gem. After checked and adjusted the version ranges, run: |
| 53 | + |
| 54 | +```bash |
| 55 | +bundle update matestack-ui-core |
| 56 | +``` |
| 57 | + |
| 58 | +and then check the installed version: |
| 59 | + |
| 60 | +```bash |
| 61 | +bundle info matestack-ui-core |
| 62 | +``` |
| 63 | + |
| 64 | +### JavaScript via AssetPipeline/Sprockets |
| 65 | + |
| 66 | +If you've installed the JavaScript dependecies via AssetPipeline/Sprockets, updating the Ruby gem is enough! Nothing to do here! |
| 67 | + |
| 68 | +### JavaScript via Yarn |
| 69 | + |
| 70 | +If you've installed the JavaScript dependecies via Yarn/Webpacker you need to update the JavaScript assets manually: |
| 71 | + |
| 72 | +In your package.json, change the version number used in the GitHub path referencing the repo of `matestack-ui-core`. This version number have to match the currently installe version of the Ruby Gem of `matestack-ui-core` |
| 73 | + |
| 74 | +`package.json` |
| 75 | + |
| 76 | +```json |
| 77 | +{ |
| 78 | + "name": "xyz", |
| 79 | + "dependencies": { |
| 80 | + // adjust the following path in order to match the Ruby Gem version! |
| 81 | + "matestack-ui-core": "https://github.com/matestack/matestack-ui-core#v1.3.0", |
| 82 | + } |
| 83 | +} |
| 84 | + |
| 85 | +``` |
| 86 | + |
| 87 | +and then run: |
| 88 | + |
| 89 | +```bash |
| 90 | +yarn install |
| 91 | +``` |
| 92 | + |
| 93 | +and finally check if the correct version is installed: |
| 94 | + |
| 95 | +```bash |
| 96 | +yarn list --pattern "matestack-ui-core" |
| 97 | +``` |
| 98 | + |
| 99 | + |
| 100 | + |
0 commit comments