Q:

Page still refreshing form_for remote true Rails 5

VERY new to Rails, and the issue I'm having is: I have a page that was one long column of check-boxes that I changed to a grid of icons with check-boxes and labels underneath; I'd like to swap out the icons images with another if the box is checked, but the original form my classmate stuck me with, doesn't want to play nice. I can get a link_to helper I use for testing to work, but not the form.
The relevant code:
#users_controller
class UsersController < ApplicationController

  def show
    @user = User.find(params[:id])
    @peaks = Peak.all.to_a
    @idx = 0
    @rng = 10
    respond_to do |format|
      format.html 
      format.js
    end
  end

  def edit
  end

  def update
    @user = current_user
    if @user.update(user_params)
      redirect_to user_path
    else
      redirect_to root_path
    end

  end

  private
    def user_params
      params.require(:user).permit(peak_ids:[])
    end

end

the test partial:
#_testajax.html.erb
<%= image_tag("badges/snow.png", :class => "no-img-circle center-block", 
height: 50, width: 50)%>
<h1>Hi J</h1>

the show page:
<div class="container">
 <div class="col-md-7">
    <%= @user.email %>
    <h3>You have climbed the following peaks:</h3>

    <ul>
      <% for peak in @user.peak_ids do %>
        <li><%= Peak.find(peak).name %></li>
      <% end %>
    </ul>

    <% total_ascent = 0 %>
    <% for peak in @user.peak_ids do %>
      <% total_ascent += Peak.find(peak).ascent %>
    <% end %>

    <h3>You have climbed a total of <%= total_ascent %> feet!</h3>

    <% total_climbed = @user.peak_ids.length %>
    <h3>You have climbed <%= (total_climbed/46.0*100).round %>% of the peaks!</h3>

    <h3>Add more climbs</h3>
<div class="container">
    <%= form_for current_user, :remote => true do |f| %>
      <!-- I kept the form_for construct, but changed the logic[here @peaks is an array!]  J. -->
        <% 5.times do %>
          <div class="row">
            <% @peaks.slice(@idx,@rng).each do |peak| %>
          <div class="col-md-1 small text-nowrap">
            <%= image_tag("badges/snow.png", :class => "no-img-circle center-block", :id => peak.id, height: 50, width: 50)%>
            <p><!-- paragraph tag needed to get the checkbox and text beneath the image N. -->
            <%= check_box_tag "user[peak_ids][]", peak.id, current_user.peaks.include?(peak) %>
            <%= peak.name %>
            </p>
          </div>
        <% end %>
      </div>
      <% @idx += @rng %><!-- instance variables for loop control N. -->
    <% end %>

  <p><%= f.submit %></p>
<% end %>
</div>
<%= link_to "Test", user_path, remote: true %>
<div id="test" style="display:none;"></div>
</div>  

  <div class="col-md-5">
    <br>
    <br>
    <br>
    <% if total_ascent > 50000 %>
     <%= image_tag 'badges/chevron-20.png', :size => "130x130" %>
      <p>50,000 ft!</p>
    <% end %>

    <% if total_climbed > 22 %>
      <%= image_tag 'badges/chevron-6.png', :size => "130x130" %>
      <p>Half way to 46!</p>
    <% end %>

    <% if @user.peak_ids.include? 1%>
      <%= image_tag 'badges/chevron-11.png', :size => "130x130" %>
      <p>Highest point in New York State!</p>
    <% end %>  

    <% if total_climbed == 46 %>
      <%= image_tag 'badges/002-crown.png', :size => "130x130" %>
      <p>You've climbed all 46 peaks!</p>
    <% end %>

  </div>
</div>

the show.js.erb file:
$('#test').html("<%= j (render 'testajax') %>"); <!-- works -->
$('#test').slideDown(350); <!-- works -->
$('edit_user_1').html('<%= j (render "testajax") %>') <!-- not working -->

$('#46').attr( "src" , "<%= image_path "badges/chevron-10.png", :id => "46" %>" ); <!-- works -->

and snippets of the generated HTML:
<div class="container">
<form class="edit_user" id="edit_user_1" action="/users/1" accept-charset="UTF-8" data-remote="true" method="post"><input name="utf8" type="hidden" value="&#x2713;" /><input type="hidden" name="_method" value="patch" />

      <div class="row">
          <div class="col-md-1 small text-nowrap">
            <img class="no-img-circle center-block" id="1" height="50" width="50" src="/assets/badges/snow-722513de9cdd817c26362e051cf1c9111e32888cc6be5b89b99855bbb46f3c88.png" alt="Snow" />
            <p><!-- paragraph tag needed to get the checkbox and text beneath the image N. -->
            <input type="checkbox" name="user[peak_ids][]" id="user_peak_ids_" value="1" checked="checked" />
            Mt. Marcy
            </p>
          </div>
    .
    .
    .
          <div class="col-md-1 small text-nowrap">
            <img class="no-img-circle center-block" id="46" height="50" width="50" src="/assets/badges/snow-722513de9cdd817c26362e051cf1c9111e32888cc6be5b89b99855bbb46f3c88.png" alt="Snow" />
            <p><!-- paragraph tag needed to get the checkbox and text beneath the image N. -->
            <input type="checkbox" name="user[peak_ids][]" id="user_peak_ids_" value="46" />
            Couchsachraga Peak
            </p>
          </div>
      </div>

  <p><input type="submit" name="commit" value="Update User" data-disable-with="Update User" /></p>
</form></div>
<a data-remote="true" href="/users/1">Test</a>
<div id="test" style="display:none;"></div>
  </div> 

I've tried many solutions over the last 24 hours, but nothing seems to work, and most of the howto's are dated. I don't ask for help very often, but this has me stumped. 
EDIT
Like stated previously, the controller appears to work for the link_to, but the page is still refreshing when I submit the form,. Thanks.
ANSWER
Thanks to Simple Lime, I was finally able to get this working, after initially misreading it, the following should go in the update action :
  def update
    @user = current_user
    respond_to do |format|
      if @user.update(user_params)
        format.html { redirect_to user_path }
        format.js { render action: :show, format: :js } #has to go here beause of .update()
      else
        format.html { redirect_to root_path }
      end
    end
  end

A:

$('edit_user_1').html('<%= j (render "testajax") %>') <!-- not working -->

On that line, you missed your octothorpe, so you're using jQuery to select an element with the tag name 'edit_user_1' (similar to selecting all paragraph tags on a page by doing $('p').
$('#edit_user_1').html('<%= j (render "testajax") %>') <!-- should work -->

unless I'm missing something in the question that appears to be the only thing not working for you?
NOTE: this will only work for that one user, using $("#edit_user_#{@user.id}") should make it work for all users, you could also do something like $('form.edit_user') if there's only the one on the page. You'll run into similar issues with $('#46') if peak.id will ever change (looks like it does), you'll probably need to figure out some other way to target that image.
For the overarching problem of the link_to working but not the form_for, form_for is submitting to the update action in the controller which just says to redirect_to user_path (which I was unaware you could do without passing it a user object, but it's apparently working for your link_to). You need to add a respond_to block and render the show.js.erb inside of it for the js requests. The following is untested but shows the general idea.
respond_to do |format|
  format.html { redirect_to user_path }
  format.js { render action: :show, format: :js }
end

