0

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
Adam Short
  • 498
  • 7
  • 28
  • Other than implying you're doing something with email, give you pointers for **WHAT**? You've provided just enough info to imply you're doing something, but that's it. So... "pick a direction and start walking". – Marc B Aug 12 '14 at 16:16
  • So my steps that I won't to follow are: - 1) dynamically connect to Mailchimp through API – create a dialogue box to enter API credentials - 2) retrieve and select from available lists in Mailchimp - 3) retrieve members of a list in mailchimp - 4) export these members into an excel/CSV file – Adam Short Aug 12 '14 at 16:20
  • Sorry, but this question is just *way* too broad to be answered here. Right now we might as well just suggest hiring someone to do this work. Go research each individual issue, and post *specific* questions when you run into problems, and post the code you've tried. – Mike Christensen Aug 12 '14 at 16:25
  • Okay I've managed to get down to wanting to export a list from MailChimp. I have the pages set up and can view a list if I manually enter an API key. However I still don't know how to handle something like this. I assume it's in the application_controller.rb file? I've never touched rails before so I don't know what direction to head in. – Adam Short Aug 12 '14 at 17:09

1 Answers1

0

You can follow below links for mailchimp integration and reading mail list in Ruby on rails.

rails on mailchimp by gem

Rails Plugin to access MailChimp and read list

But, If you want me to explain in C#, then i can tell you point by point.

Community
  • 1
  • 1
Rudra21
  • 242
  • 3
  • 13