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

More explicit phoenix template rendering #35

Closed
paulcsmith opened this issue Jan 8, 2016 · 0 comments
Closed

More explicit phoenix template rendering #35

paulcsmith opened this issue Jan 8, 2016 · 0 comments

Comments

@paulcsmith
Copy link
Contributor

Right now view rendering uses Phoenix.View.render_existing which is ok except that it can make it easy to think you're sending an email with both formats, but in reality you had a typo in a template name and you only send a text or html version. Instead I think this should be more explicit so you get more immediate and helpful feedback.

Right now you do: render("template_name") which will render a text or html template if it exists

Instead I think it should be render("template_name.html") and render("template_name.text") if you have just one type of template to send.

If you want to send text and html then you would do render(:template_name) and it will render both and raise if either one is missing.

@paulcsmith paulcsmith changed the title More explicit phoenix view rendering More explicit phoenix template rendering Jan 23, 2016
paulcsmith pushed a commit that referenced this issue Jan 23, 2016
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

No branches or pull requests

1 participant