Customize ViewComponentsController #412
-
I'd like to customize the controller used for previews, but setting a controller like it is mentioned in the readme doesn't work:
Is the Background is: My desired layout needs some controller logic and before filters (like authorization) and I'd like to display them in a different style. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
@juanmanuelramallo can you provide some context here? Perhaps we should clarify this behavior in the README. |
Beta Was this translation helpful? Give feedback.
-
Yes, only for tests. We should update the readme to state that.
Can you try overriding the controller and just adding the before actions you need? For the different style in the index and examples view I guess you would need to call |
Beta Was this translation helpful? Give feedback.
Yes, only for tests. We should update the readme to state that.
Can you try overriding the controller and just adding the before actions you need?
For the different style in the index and examples view I guess you would need to call
ViewComponentsController#prepend_application_view_paths
from inside your overridden controller, so that you can use your own views to update the style as you want.