Im currently trying to just build a simple splash page that has one
input field for a form which is their email.
Im trying to use the Mailchimp and gibbon gem. When im on my localhost
and try to input my email and submit it.... nothing happens. I get an
error in my terminal saying 500 error, email must contain one '@'....
WHICH it does contain only one.
I guess what I'm trying to figure out is.... without any tables or
models can I take in a users email address and sent it to my mailchimp
account for future email marketing for my info.
I guess what I'm trying to figure out is.... without any tables or
models can I take in a users email address and sent it to my mailchimp
account for future email marketing for my info.
Yes, you can do that, no problem.
You probably need to back up and provide us more info about what you're
doing and the exact error message.
When I hit submit with my valid email address I get this error response
in my terminal
Started POST "/emailapi/subscribe" for ::1 at 2015-07-21 19:10:28 -0500
Processing by EmailapisController#subscribe as JS
Parameters: {"utf8"=>"✓",
"email"=>{"address"=>"teubanks@tutelaholding.com"}, "commit"=>"Sign me
up for the abs!"}
Completed 500 Internal Server Error in 2490ms (ActiveRecord: 0.0ms)
Gibbon::MailChimpError (An email address must contain a single @):
app/controllers/emailapis_controller.rb:8:in `subscribe'
-------CONTROLLER--------
class EmailapisController < ApplicationController
def index
end
gb.lists.subscribe({:id => ENV['mailchimp_id'],
:email => {:email =>'address'}
})
end
end
-------VIEW--------
<div class="landing-box">
<div class="call-action">
<h1>Free weekly Ab Workouts!</h1>
<h4>This isnt your typcal Richard Simmons routine.</h4>
<%= form_tag('/emailapi/subscribe', method: "post", id: "subscribe",
remote: "true") do %>
<%= email_field(:email, :address, {id: "email", placeholder: "email
address"}) %>
<%= submit_tag("Sign me up for the abs!", :class => "btn
btn-success") %>
<% end %>
</div>
<div class="col-md-8 col-md-offset-2">
<div class="final-word">
<p>Stop <i>GUESSING</i> what to do by getting weekly guides on
affective routines! Just type in your email and recieve a weekly ab
routine totally free!</p>
</div>
</div>
</div>
I totally feel that I'm missing some major but simple things here. When
i submit the email address the site has NO visual errors just errors
shown are the ones in the terminal stated above
While I know nothing about that gem you're using, I suspect that it does not take a key and then use it to access params. So you're in effect trying to sign up with an address that is literally the string 'address'. Where the email address you obviously want to send to MailChimp is in params[:email][:address].
I'd also question whether the gem really wants an argument of the form :email => {:email => ...}, but I don't know that's wrong--something else for you to check.
I guess what I'm trying to figure out is.... without any tables or
models can I take in a users email address and sent it to my mailchimp
account for future email marketing for my info.
Yes, you can do that, no problem.
You probably need to back up and provide us more info about what you're
doing and the exact error message.
When I hit submit with my valid email address I get this error response
in my terminal
Started POST "/emailapi/subscribe" for ::1 at 2015-07-21 19:10:28 -0500
Processing by EmailapisController#subscribe as JS
Parameters: {"utf8"=>"✓",
"email"=>{"address"=>"teubanks@tutelaholding.com"}, "commit"=>"Sign me
up for the abs!"}
Completed 500 Internal Server Error in 2490ms (ActiveRecord: 0.0ms)
Gibbon::MailChimpError (An email address must contain a single @):
app/controllers/emailapis_controller.rb:8:in `subscribe'
-------CONTROLLER--------
class EmailapisController < ApplicationController
def index
end