I'm trying to create a simple rails app where user can send me a SMS via Twilio. A user just needs to fill in the form on the home page with his name, email, some text and submit it. I need to create a function that would grab those 3 pieces of information from params, create a text message and send it to my phone number, but I have no idea how to do that.
Those are the form and routes that I tried to create for this:
View: app/views/home/index.html.erb
<div>
<%= form_for @phone, url: 'home/send_text' do |f| %>
<%= f.label :name %>
<%= f.text_field :name %>
<%= f.label :email %>
<%= f.text_field :email %>
<%= f.label :message %>
<%= f.text_field :message %>
<%= f.submit 'Submit', class: "btn btn-primary" %>
<% end %>
</div>
Routes:
Rails.application.routes.draw do
root 'home#index'
post 'home/send_text'
end