Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ActionView::MissingTempateError when requesting entity views by JS #1243

Merged
merged 1 commit into from
Feb 24, 2024

Conversation

steveyken
Copy link
Member

In some cases, when fetching an entity view by JS, ActionView has a hard time finding the template to render and throws an error.

This can be fixed by extracting the format from the template name and passing it inside the formats parameter.

Old format: render template: "contacts/show.html"
New format: render template: "contacts/show", formats: [:html]

Useful references;

@steveyken steveyken requested a review from CloCkWeRX February 24, 2024 02:47
@CloCkWeRX CloCkWeRX merged commit 862a098 into master Feb 24, 2024
8 checks passed
@steveyken steveyken deleted the fix-render-template branch August 21, 2024 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants