title: Gibbon / Mailchimp Signup Form
body: <p>Having some trouble creating a simple signup form for a mailchimp list. Can't figure out why when they email passes through, it doesn't pass over to mailchimp.. thoughts? I'm sure I missed a step here.</p>
  
  <p>index.html.erb (Form)</p>
  
  <pre><code>&lt;%= form_tag('/welcome/subscribe', method: "post", id: "subscribe",) do -%&gt;
  &lt;%= email_field(:email, :address, {id: "email", placeholder: "email address"}) %&gt;
  &lt;%= submit_tag("Join!") %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>Gibbon.rb (Initializer)</p>
  
  <pre><code>Gibbon::API.api_key = "Secret API Key"
  Gibbon::API.timeout = 15
  Gibbon::API.throws_exceptions = false
  </code></pre>
  
  <p>Welcome.rb (Model)</p>
  
  <pre><code>def subscribe
  
  @list_id = "Secret List ID"
  gb = Gibbon::API.new
  
  gb.lists.subscribe({
    :id =&gt; @list_id,
    :email =&gt; {:email =&gt; params[:email][:address]}
    })
  end
  </code></pre>
  
  <p>Routes.rb</p>
  
  <pre><code>Rails.application.routes.draw do
  root 'welcome#index'
  post 'welcome/subscribe' =&gt; 'welcome#subscribe'
  end
  </code></pre>