The reason you're getting that error is the fact you have no view to be rendered, e.g. app/views/twilio/send_text_message.html.slim
.
If the code comes to the end of the action without an interrupt, it will try and render the associated view.
class TwilioController < ApplicationController
def send_text_message
$twilio_client.account.messages.create(
:from => '+14159341234',
:to => '+16105557069',
:body => ..params from form..
)
redirect_to root_path, notice: 'Your SMS has been sent' # This is the interrupt that will make it so it doesn't try to render the view
end
end