Is is possible to control what relationships to use? #325
-
I'm interesting if it's possible to control relationships in next way:
I know it's possible with params, but would be good to have some approach like showed above. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
@NaumenkoSergiy Could you provide the expected output? |
Beta Was this translation helpful? Give feedback.
-
=>
=>
so, just control relationships with something like |
Beta Was this translation helpful? Give feedback.
-
@okuramasafumi thank you, it helps |
Beta Was this translation helpful? Give feedback.
https://github.com/okuramasafumi/alba#conditional-attributes
Does this help?
https://github.com/okuramasafumi/alba/blob/main/test/usecases/conditional_attributes_test.rb
This test case shows you how to use it, especially with
params
.