Sha256: 8805eec0dce93cb7b5a77dddd94aa326cf5a6ae215ead990f858094976bf19e0

Contents?: true

Size: 1.96 KB

Versions: 65

Compression:

Stored size: 1.96 KB

Contents

# Overriding Framework Defaults

Most of Bullet Train's functionality is distributed via Ruby gems, not the starter template. We provide the `bin/resolve` tool to help developers figure out which Ruby gem packages are providing which classes, modules, views, and translations, and its usage is covered in the [Dealing With Indirection](/docs/indirection.md) section of the documentation.

However, sometimes you will need to do more than just understand where something is coming from and how it works in the framework. In some situations, you'll specifically want to change or override the default framework behavior. The primary workflow for doing this is much the same as the `bin/resolve` workflow for dealing with indirection in the first place, however, instead of just using `--open` to inspect the source of the framework-provided file, you can add `--eject` to have that file copied into the local repository. From there, it will act as a replacement for the framework-provided file, and you can modify the behavior as needed.

## The Important Role of Active Support Concerns in Bullet Train Customization

When it comes to object-oriented classes, wholesale copying framework files into your local repository just to be able to modify their behavior or extend them would quickly be untenable, as your app would no longer see upstream updates that would otherwise be incorporated into your application via `bundle update`.

For this reason, common points of extension like framework-provided models and controllers actually exist as a kind of "stub" in the local repository, but include their base functionality from framework-provided concerns, like so:

```
class User < ApplicationRecord
  include Users::Base

  # ...
end
```

In this case, for most customizations or extensions you would want to make, you don't need to eject `Users::Core` into your local repository. Instead, you can simply re-define methods from that concern in your local `User` model after the inclusion of the concern.

Version data entries

65 entries across 65 versions & 1 rubygems

Version Path
bullet_train-1.2.10 docs/overriding.md
bullet_train-1.2.9 docs/overriding.md
bullet_train-1.2.8 docs/overriding.md
bullet_train-1.2.7 docs/overriding.md
bullet_train-1.2.6 docs/overriding.md
bullet_train-1.2.5 docs/overriding.md
bullet_train-1.2.4 docs/overriding.md
bullet_train-1.2.3 docs/overriding.md
bullet_train-1.2.2 docs/overriding.md
bullet_train-1.2.1 docs/overriding.md
bullet_train-1.2.0 docs/overriding.md
bullet_train-1.1.10 docs/overriding.md
bullet_train-1.1.9 docs/overriding.md
bullet_train-1.1.7 docs/overriding.md
bullet_train-1.1.6 docs/overriding.md
bullet_train-1.1.5 docs/overriding.md
bullet_train-1.1.4 docs/overriding.md
bullet_train-1.1.3 docs/overriding.md
bullet_train-1.1.2 docs/overriding.md
bullet_train-1.1.1 docs/overriding.md