Skip to content

Customize ViewComponentsController #412

Discussion options

You must be logged in to vote

Is the config.view_component.test_controller only for tests and not for previews?

Yes, only for tests. We should update the readme to state that.

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.

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.

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
2 replies
@juanmanuelramallo
Comment options

@joelhawksley
Comment options

Comment options

You must be logged in to vote
4 replies
@23tux
Comment options

@23tux
Comment options

@juanmanuelramallo
Comment options

@jonspalmer
Comment options

Answer selected by 23tux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants