<%= render 'requests/new_request_form', request: Request.new %>
<%= button_to 'Group Activity', river_path, method: 'get' %>
<%= button_to 'Active Requests', active_path, method: 'get' %>
<%= button_to 'Your History', history_path, method: 'get' %>
<%= button_to 'Moved? Update Your Neighborhood', groups_assign_path, method: 'get' %>

<div id="river">
  <ul id="group-transactions">
  </ul>
</div>

<script type="text/javascript" charset="utf-8">
  var pusher = new Pusher('545220afdca7480dd648', {
    encrypted: true,
    authEndpoint: '/pusher/groupauth',
    auth: {
      headers: {
        'X-CSRF-Token': '<%= form_authenticity_token %>'
      }
    }
  });

  var channel = pusher.subscribe('presence-<%= current_user.group_id %>');

  channel.bind("new_transaction", function(data) {
    var element = '<li>' + data.content + '</li>';

    $('#group-transactions').append(element);

    if (data.user_id === <%= current_user.id %>) {
      $('#my-transactions').append(element);
    }

  });

  channel.bind("new_request_posted", function(data) {
    $('#active-requests').append('<li>' + data.content + '</li>');
  });
</script>

<%= render 'requests/new_request_form', request: Request.new %>
<div class='row collapse'>
  <ul class='button-group even-3 small-12 columns river-nav'>
  <li><%= button_to 'Community', river_path, method: 'get', class: 'small button river-btn' %></li>
  <li><%= button_to 'Active', active_path, method: 'get', class: 'small button river-btn' %></li>
  <li><%= button_to 'History', history_path, method: 'get', class: 'small button river-btn' %></li>
  </ul>
</div>

<div id="river">
  <ul id="group-transactions">
  </ul>
</div>

<script type="text/javascript" charset="utf-8">
  var pusher = new Pusher('545220afdca7480dd648', {
    encrypted: true,
    authEndpoint: '/pusher/groupauth',
    auth: {
      headers: {
        'X-CSRF-Token': '<%= form_authenticity_token %>'
      }
    }
  });

  var channel = pusher.subscribe('presence-<%= current_user.group_id %>');

  channel.bind("new_transaction", function(data) {
    var element = '<li>' + data.content + '</li>';

    $('#group-transactions').append(element);

    if (data.user_id === <%= current_user.id %>) {
      $('#my-transactions').append(element);
    }

  });

  channel.bind("new_request_posted", function(data) {
    $('#active-requests').append('<li>' + data.content + '</li>');
  });
</script>

Format form and button group
Format form and button group
