This is not a definitive guide and it’s also not optimal, however, it works and it explains the concept well.
Tech stack: Ruby on Rails for the backend, React and Redux on the frontend (stay tuned).
Note: cursor based navigation is better, but I’ve only just learned about it, so when I implement it, I’ll write a post about it.
The first thing we need to do is paginate the data on the back end. (paginate = divide the data up into pages.)
so when our posts controller requests an index of posts from model, it needs to specify which…
what is closure? There’s a short answer and a long answer.
The short answer is: read the long answer.
You know how variables declared inside a function disappear once the function is done? Weeeellll… that doesn’t always happen. and here’s why.
I am very excited to introduce a new concept in social media advertising that will benefit all parties involved.
Social media ads are disliked by most users. this is an unvalidated claim that I’m nevertheless comfortable making. A user scrolling through their feed has little or no interest in seeing ads. Additionally, an ad today will be disguised as a post or a tweet, with only a small indication that its promoted or sponsored.
The concept is so simple, every nth post is covered by an ad. to get to the post you simply need tap or click on the…
For my Mod 3 project, I made an eCommercesque app. when I got to the stretch goal of adding purchasing capability, I noticed that my join table for items and purchases was identical to my join table for item and cart. additionally, whenever I would need to create a purchaseItem, I would have to also destroy the corresponding CartItem.
This got me thinking, what if I just made the cartItem polymorphic?
my schema looks something like:
Cart -< CartItem >- Item
My purchase would look like:
Purchase -< PurchaseItem >- Item
I won’t go into too much detail, but I…
Struggling to understand the DOM? It’s not your fault, you’re being taught wrong.
Calling the DOM a tree is accurate, once you are familiar with the DOM and trees, not the green leafy kind that you don’t see in the city, but the tree data structure. But trying to explain the DOM to beginners as a tree is foolish, and a colossal waste of time
You see, as a beginner, being told that the DOM is a tree makes no sense and there are many ways that calling the DOM a tree makes it actually harder to understand.
I’ll jump right in to a description of my first tango with setting up dual UIs in a single rails app.
The app is a barebones food ordering app inspired by grubzhlub or stretchmarks
This can be accomplished in 4 steps. Let’s take a quick look at them.
Our new user type, restaurant, can share login pages with the original user type which is, ahem, called user. …
Darrel was feeling gloomy that Monday as he bumped his way up 7th Ave towards his office. He was ready to shove the next glare victim distracted by the hud on his glasses but he shied from physical force. He could count on one hand how many fistfights he had gotten into. He finally made it onto the elevator, his face inches from a pair of darting eyes behind glowing glare specs that freaked him enough, so he shut his and shuddered, the other was unaware of him, and probably didn’t see him.
Darrel was surprised to see Zaq sitting…
Hello there, suppose you wanted to create a new image sharing platform for very wise people, called say, Instagramps. Smart coder that you are you’d of course be using Ruby, and, of course, ActiveRecord.
One of the many wonderful features ActiveRecord provides is the ability to endow a class with many association methods by just typing a few words. But don’t take my word for it, let’s start building this cool app and I’ll show you along the way.
Let’s start by building out the classes for our app.
class Image < ActiveRecord::Base
endclass User < ActiveRecord::Base