Skip to content
Discussion options

You must be logged in to vote

@cabra-andrade Here's one route you might want to consider:

  1. Turn your current DriverComponent into an ActiveSupport::Concern (or regular module), e.g.:
class DriverComponent < ApplicationComponent
   ...
end

to:

module DriverComponent
  extend ActiveSupport::Concern
 
  ...
end

You may need to move some code into the included or class_methods blocks provided by Concern as appropriate.

  1. Create a LargeDriverComponent and XSDriverComponent. include DriverComponent in each of these, and copy and rename the variant templates you had previously to the appropriate locations for these components.
  2. Initialize an array of each type of component based on the same data. For example:
# Assuming you …

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@boardfish
Comment options

Answer selected by joelhawksley
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants