Isaac Ben Hutta


210 Experience
0 Lessons Completed
0 Questions Solved


Posted in Action Cable vs Mailboxer?

Action Cable uses web sockets which means that message exchanging happens in real time. Much more user friendly.
Mailboxer as far as I can tell requires the user to refresh the page.

Posted in GoRails speed

Francisco, check out the Memoization tutorial. I assume these are one of the things Chris uses to make this app fast.

Posted in GoRails speed

Hi Chris,
It would be nice if you could share with us what techniques you use to make this site so fast, and if and how do you deal with scaling problems.

Posted in How "expensive" are API calls?

Wow, thanks for the thorough response. I actually got better in it since last time we talk. I'm able to register and login users from my React app now. The reason I'm doing it is for React Native. It's much better than all the other options that just render a web view. In general I would never build an SPA since like you said, turbolinks does it for you already.
I also ditched Devise in favor of Michael Hartl auth system since it gives me more flexibility.

Posted in How "expensive" are API calls?

I was thinking about an SPA that has a like button. In "Liking Post" tutorial you wrote a method that checks if the current user liked the post, but in an SPA that means I will have to make a call to the API to check that. Does this mean your app will be slower in general? Isn't it faster to it hit the database from a monolithic app instead of calling API's from a client app?

Posted in Display user

If it helps this code works for me. The image is a Facebook avatar, but I don't think it makes a difference.

$(function() {
  return $('[data-behavior="autocomplete"]').atwho({
    displayTpl: "<li><img class='img-circle' src='${image}' height='20' width='20'/> ${name} </li>",
    at: "@",
    'data': "/meals.json"

Posted in Front-end frameworks and Turbolinks

Sorry that I can't help you, but just wanted to share that today I ditched Turbolinks. I'm using lightbox navigation. Similar to what Pinterest does and since I pushstate manually to change the URL it messed up the back button so I had to remove Turbolinks and now everything works perfect.
I do think that Turbolinks is great, but in some cases it makes problems. I'm sure you can solve yours. The question is how and if it's worth your time.
Good luck either way.

Posted in How to know if the user is logged in, in a mobile app.

Thanks Chris, exactly what I needed to know.

Posted in How to know if the user is logged in, in a mobile app.

Hey guys, I'm trying to figure out how the user authentication works with mobile apps that consumes the Rails API.
I know I can send a POST request to the server to register the user and then generate a token so I will authenticate him on every request.
The question is, how do I know that the user is logged in from the beginning? The API is stateless from what I understand. So what if I want to use statements like "If user logged in then do this..." Inside the mobile app.
Any guidance would be helpful.