Mohamad El-Husseini


20 Experience
0 Lessons Completed
0 Questions Solved


Posted in In-App Navbar Notifications Discussion

Great episode, Chris. A cleaner and easier way to set the type node in your jbuilder template would be to use Rails' built in I18n support. So instead of `"a #{notification.notifiable.class.to_s.underscore.humanize.downcase}"`, you can do:

`"a #{notifiable.model_name.human}"`

This is cleaner and easier, and ensures that if the model name changes, the change will be reflected in your entire app. For this to work you need to set the model name in your I18n file. So en.yml would have:


post: "post"

PS: I would love to see this in React.

Posted in jQuery UJS Callbacks Discussion

Hi Chris, thanks for the screencast. I've enjoyed several episodes already. I feel though that this is an area (Rails UJS) that can be covered better. There are many tutorials on Rails UJS stuff, so rehashing the basics can only get us so far. What is lacking, I feel, are some interesting stuff like working with events to show/hide spinners, overriding confirm boxes, updating the DOM without rendering server side JS, reusable modals, working with UJS and Turbolinks, Turbolinks and Turbolinks 3, etc...