-1

I've been trying to follow another SO answer with no luck.

My main goal is to refresh the partial when I click a div

Maybe someone can help trouble shoot. It must be a syntax error (maybe..).

in my gobal.js I have:

$('.reset').on('click', function(){
      $(".friend").load('/users_controller/load_friend');
});

in my users_controller i have :

      def load_friend
        render :partial => 'friend_image'
      end

in my markup / haml I have:

 .friend
    =render 'friend_image'   

the file / partial is under the users controller directory, and is named:

_friend_image.html.haml

where have I gone wrong? Let me know if you need more info.


error message:

localhost:3000/users_controller/load_friend 404 (Not Found)

this is the original example I have tried to follow: SO example

Community
  • 1
  • 1
NoobSter
  • 1,150
  • 1
  • 16
  • 39

1 Answers1

1

change $(".friend").load('/users_controller/load_friend'); to $(".friend").load('/users/load_friend');

Roaring Stones
  • 1,054
  • 7
  • 22