Giving the user the ability to upload files to your application should be a tool all developers should have in their back pocket. Though it may seem easy in theory, there’s a lot of overhead that needs to be done to get your database and frontend setup for this type of information.
To start off, this is a guide for Rails as an API in the backend, and React.js in the frontend. First things first, when setting up your backend you’ll need to set up Active Storage so that your database can handle file uploads. It’s as simple as running:
Greetings reader, if you’re a newbie like me in the world of React then you’ve probably stumbled upon the conundrum of adjusting state outside of the parent component.
To start off, let’s get a good understanding of what state is. State in react is essentially;
As a student learning their way around Ruby on Rails I’ve had many rough patches, but once I started learning how to maneuver around in the back end I wanted to create an efficient way for the user to maneuver around the front end!
As a beginner in the coding world we have many questions and an overwhelming amount of resources that we can learn from. Finding out the differences between buttons and links is too much, and that’s why you’re here.
Buttons are written like this:
<%= button_to("button", path, method) %>
Let’s break this down. The begging of the button, before it even says “button_to” is an ERB tag. There are only three important ERB tags that a beginner should know about. …
I would like to preface this blog by stating I AM NEW TO CODING, oh and I AM NEW TO BLOGGING.
Coding is incredibly DRY(pun intended.) When I say that I mean, it’s just numbers and letters on a screen. There isn’t anything stimulating on the screen and for people like me that are visual learners, understanding material is incredibly difficult. I can’t learn what I can’t picture, therefore in my mind I have to ‘visualize’ what the code I’m writing does. For example, let’s take a Class (or a thing or an object) like Horses!
In code world, this is what it would look…