Ilya Bodrov is a senior engineer working at Campaigner LLC, teaching assistant at Learnable and lecturer at Russian State Technological University (Internet Technology department). His primary programming languages are Ruby (with Rails) and JavaScript (AngularJS). He enjoys coding, teaching people and learning new things. Ilya also has some Cisco and Microsoft certificates and was working as a tutor in an educational center for a couple of years. In his free time he writes posts for his website, participates in OpenSource projects, goes in for sports and plays music.

Ilya's articles

  1. Uploading Videos to YouTube with Rails

    Media Player App Icon

    In my previous articles, I’ve already explained how to integrate uploading in your app and how to make uploading process asynchronous (as well as upload multiple files). Today, we will take another step forward and create an app that allows users to upload videos to YouTube.

    We’ll utilize the OAuth2 protocol, as well as youtube_it gem to work with the YouTube API (if you wish to learn more about YT API take a look at my article, YouTube on Rails). At the end, I’ll cover some potential gotchas you might face (believe me, some of them are quite annoying).

    The source code for the demo app is available on GitHub.

    A working demo can be found at http://sitepoint-yt-uploader.herokuapp.com/.

  2. Asynchronous File Uploads in Rails

    Today, we’ll explore a bit more about file uploading, such as how to implement asynchronous file uploading with Rails as well as uploading multiple files using AJAX.

    We are going to take a look at two solutions: Remotipart and File Upload.

    Some other things to be covered in this article:

    • Creating a progress bar to track the file uploading progress and display bitrate.
    • Implementing client-side validation.
    • Adding a “dropzone” with some nice CSS3 effects, allowing users to drag & drop files to be uploaded.
  3. Better File Uploads with Dragonfly

    File uploading is a vital part of the web. We upload our photos, videos, and music to share them. We send e-mails with a bunch of attachments; probably every active Internet user uploads something at least once a day (well, that’s my guess :)).

    You’ve probably been given a task to create a system to allow users to upload files as a part of an app. If not – well, it will sooner or later :).

    I am going to introduce you Dragonfly – a popular gem used for handling images and other attachments. Some of the features that will be covered are:

    • Integration with ImageMagick, image processing and analysis.
    • How to upload images to Amazon S3 instead of the local file system.
  4. Forem – A Rails Forum Engine

    Have you ever wanted to set up a forum for your lovely website? There are tons of solutions out there
    that you can use for this task. However, what about a forum that is integrated directly
    into your Rails app? One that can be modified the way you want? Awhile back, I tried to answer exactly the same question and found that there are only a few forum gems available.

    Searching for a Perfect Forum

    First of all, there is Altered Beast. It used to be somewhat popular, however it was last updated 5 years ago and it does not support even Rails 3.

    Also, there is Forum Monster that seems to be a better option. It provides a handful of features and was last updated in July 2013. However, it is not being actively maintained – there are only three commits in 2013 and no commits in 2014.

    Roman Forum, Rome

    I also found Savage Beast (seems like all forum developers love
    monsters) but it was last updated in 2009, so this is not an option.

    The last solution I found was rBoard but its homepage says that the project is no longer maintained as it was transferred to Forem. So,I visited Forem’s page and… EUREKA! Forem appeared to be a full-fledged forum engine with an active (well, not very active community) and a lot of useful features, including:

    • Basic operations (creating/updating/deleting categories/forums/topics)
    • Locking/pinning/hiding topics
    • Replying and quoting posts
    • Managing user groups and assigning moderators
    • Text formatting with pluggable formatters, code highlighting, and an ability to use smileys
    • Integration with Gravatar
    • Theming (with an ability to create custom themes)
    • Permissions system
    • Translation to a variety of languages
    • Ability to integrate with RefineryCMS.

    Forem was created (and is primarily maintained) by Ryan Bigg and (at the time of writing) has more than 1300 commits.

    In this article, I will demonstrate how to set up Forem and point out some gotchas.

  5. Nested Comments with Rails

    Comments are everywhere. Blogs, social networks, fan sites, learning resources – they all have some kind of a commenting system. Often we would like to present our users options to both leave a comment and reply as well. The most natural way to represent replies is to nest them (like a Russian doll).

    This article shows how to implement nested comments in a Rails app with the help of the closure_tree gem. Also, it will describe some cool features that the gem provides, pinpointing gotchas along the way.

  6. Versioning with PaperTrail

    Imagine this situation: You open your website’s admin page to do some clean up, find some old data that hasn’t been viewed by anyone for ages, and delete it. Deletion succeeds and everything is okay…but after a second… “NOOOO!!! That data contained VERY IMPORTANT INFORMATION that could possibly change the world!”, you realize. But, it’s gone and the world remains unchanged (well, there is still a chance for recovery if you have a backup of the DB :)).

    Can we prevent this situation in our Rails app? Yes, we can! paper_trail to the rescue!

    In this article, we are going to talk about how to implement a “History” page and an “undo” button (as well as “redo”) with the help of the paper_trail gem.

  7. YouTube on Rails

    I will show you how to create a web application that allows users to add and watch videos from YouTube. Upon adding, the video’s info will be fetched automatically via the YouTube API. This app will also display these added videos using the typical YouTube player with the help of the YouTube IFrame API. Lastly, there are some potential problems and gotchas that you might face.

  8. Infinite Scrolling with Rails, In Practice

    In the predecessor to this article, we set up a very simple blog with demo posts and implemented infinite scrolling instead of simple pagination. We used will_paginate and some javascript to achieve this task.

  9. Infinite Scrolling in Rails: The Basics

    no_load_more

    Pagination is a very common and widely-used navigation technique, and with good reason. First of all, consider performance. Loading all the available records in a single query can be very costly. Moreover, a user may be interested only in a couple of the most recent records (i.e., the latest posts in a blog) and does not want to wait for all records to load and render. Also, pagination makes reading the page easier by not flooding it with content.

    Nowadays, many websites use a slightly different technique, called infinite scrolling (or endless page). Basically, as the user scrolls down the page, more records are loaded asynchronously using AJAX. In this manner, scrolling seems more natural and can be easier for a user than constantly clicking on a ‘Next page’ link.

    In this article, I am going to explain how to implement infinite scrolling in place of classic pagination.

    First, we will prepare our demo project, implementing basic pagination using the will_paginate gem. This pagination will become infinite scrolling as we work through the tutorial. This will require writing some JavaScript (and CoffeeScript) code, along side our Ruby.

    The provided solution will fallback to the default pagination if a user has javascript disabled in the browser. Finally, our view will require virtually no modifications, so you can easily implement this on any website.

    Other items that will be covered:

    • How to implement a “Load more” button instead of infinite scrolling, much like the one
      used on SitePoint.
    • Some gotchas and potential problems, specifically, how the History API and scroll spying can help us.

    The working demo can be found at http://sitepoint-infinite-scrolling.herokuapp.com.

    The source code can be found on GitHub.

    Sound good? Let’s get rolling!