constantcontact / ruby-sdk

Constant Contact Ruby SDK for v2 API
Other
17 stars 47 forks source link

correction added to 'Getting Started' examples in README #54

Closed jorge8989 closed 8 years ago

jorge8989 commented 8 years ago

Hello, i added the constantcontact gem to my rails app

gem 'constantcontact', '~> 2.2.0'

and followed the 'Getting started' guide, but i had this exception

undefined method `each' for #<ConstantContact::Components::ResultSet:0x000000052b84a0>

ruby-sdk_exception

i fixed it replacing this:


<% if @contacts.present? %>
  <% @contacts.each do |contact| %>
    <p>Contact name: <%= "#{contact.first_name} #{contact.last_name}" %></p>
  <% end %>
<% end %>

With this:


<% if @contacts.present? %>
  <% @contacts.results.each do |contact| %>
    <p>Contact name: <%= "#{contact.first_name} #{contact.last_name}" %></p>
  <% end %>
<% end %>

This Pull Request add this correction to the 'Getting Started' guide, Thanks.

shannon7wallace commented 8 years ago

Thanks Jorge! Merged!