User Avatars Everybody knows what user avatars are. But if you’ve been living under a rock; ‘user avatars’ or ‘Profile Pictures’ are graphical illustrations of a user’s persona or character; i.e they represent/describe the user’s personality or alter ego. The word ‘avatar’ comes from the sanskrit language meaning ‘a manifestation of a deity or released…
Continue ReadingSEO friendly URLs with friendly_id
What is a SEO friendly URL ? So, normally rails’ routes looks like these: ‘/posts/122’, ‘/photos/45531, ‘blog/posts/54222’ and so on. This is because rails finds the resource’s records by looking at the record id. This is alright for private applications like research apps, academic apps, management apps, etc. But, if you were to build a…
Continue ReadingHeroku Environment Variables
What Are Environment Variables ? Storing credentials like access keys, secret keys, SMTP passwords, etc in the source is never a good idea, especially in production; Because it may be vulnerable to hacks or you might want to share the source code with other developers. So, there are Environment Variables for that. We can use…
Continue ReadingEnabling Gzip Compression in your rails apps
What is Gzip Compression? Gzip compression is a quick and easy way to speed up the loading times of your web application. This can be done by compressing the static assets like stylesheets, javascripts, etc before serving them to the web browser. This can save a lot of bandwidth and as well as make your…
Continue ReadingValidating File Uploads with file_validators
File Validations File validations are a must for any web application that handles file uploads. Especially, if your web app has public access or is made for public use or will be used by multiple users. Say for instance if you have a photosharing web app; where users can upload photos. If you didn’t validate…
Continue ReadingUsing wavesurfer.js With Rails
Wavesurfer.js Wavesurfer is a javascript library to analyze audio files and create an audio spectrum. It’s very similar to the ones that you can find on soundcloud and other music streaming sites. Wavesurfer also comes with its own audio player, so no additional HTML5 audio player is required. This javascript library is a very cool…
Continue ReadingSome Popular Gems For Your Rails Apps
Popular Ruby Gems These are the most popular gems that i have used at some point, when building web applications with ruby on rails. These features and functionalities can also be added from scratch without using any ruby gems, but using ruby gems is a much better, faster and practical way to implement those features…
Continue ReadingAuthorization With Pundit
What is Authorization ? Authorization is a method to permit or restrict different users or user groups by assigning them with different user access levels or privileges. This can be done by assigning every user or group of users with different access levels or user roles, roles such as admin, editor, subscriber, end user, etc….
Continue ReadingDisplay uploaded videos with VideoJS
What is VideoJS ? VideoJS is a client-side javascript library for displaying/showing/playing/embedding videos with a video player on the web browser, with controls such as volume controls, forward, skip, play, pause, etc. We can also display uploaded videos directly without even using this library as HTML5 already supports videos. But with videoJS we can have…
Continue ReadingFor Beginners: User Authentication with devise
What is Authentication ? I guess you already know what authentication is. But if you have been living under a rock since the last decade: Authentication basically is a method to grant access to users who are using your app by verifying the identity of the user. This can be done by providing credentials like…
Continue Reading