Edit: I've rewritten this question to be more specific. So I have a log in box and what I'd like to do, is when the user presses the log in button, pass the value from text_field_tag to my application controller and set a variable there. I'm not sure how to do this, so I guess I'm asking how to link the view and controller together and then how to pass the value using parameters. Here's my view:
<% content_for :title, "Home" %>
<h2>MailChimp API Login</h2>
<%= form_tag do %>
<p>
<%= text_field_tag(:apikey) %>
</p>
<p><%= submit_tag "Log In", :name => "apikey" %></p>
<% end %>
and my application_controller:
require 'mailchimp'
class ApplicationController < ActionController::Base
before_action :setup_mcapi
def setup_mcapi
@mc = Mailchimp::API.new(params[:apikey])
end
end