-
Notifications
You must be signed in to change notification settings - Fork 14
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
Using with Phoenix Framework #7
Comments
Hi Adam, Where you put the render function is up to you, but I suggest that you create a module in To actually use the render function, add this function to your def xml(conn, value) do
conn = %{conn | resp_headers: [{"content-type", "application/xml"}]
send_resp conn, 200, value
end This will add this def index(conn, _params) do
xml conn, MyApp.MyModule.render
end If you're going to be rendering a lot of TwiML, I recommend that you also check out my Telephonist repo. It can help you organize all the rendering into an elegant state machine. |
Daniel, Thanks for the thorough response. I do indeed have a lot of TwiML, currently about 300 lines residing in a Sinatra app that's begging to be rewritten. I came across Telephonist after I posted this question, it looks perfect for my needs. Without wishing to pollute this repo's issues, I don't suppose there is a more detailed blog post planned for setting up Telephonist with Phoenix is there? :) |
@adamwiggall I don't have a blog post on using Telephonist with Phoenix yet, no. It'll be a couple weeks before I can come out with one, but I'll add it to my list. I've tried to make the telephonist docs pretty comprehensive, so hopefully that helps. |
Thanks Daniel, I look forward to the post, and I'll work through the documentation. |
Daniel,
This looks like a great package. As an Elixir/Phoenix newcomer how might I use it with the Phoenix Framework?
I have it installed as a dependency but I'm unsure where to put the render method and how it sits with views and templates.
Thanks in advance
The text was updated successfully, but these errors were encountered: