Category: Code
-
Getting Started with the Command Line (Mac Version)
If you’re serious about becoming a web developer, you will have to learn how to use the command line at some point. You might be a front-end developer that hasn’t had to use it before, but when you start getting into more complex development like working with React or SASS, you’re going to be using…
-
How to Make Your a Tags and buttons Look Much Better in Just a Few Lines of Code
If you do any front-end development work at all, you’re going to have to work with user interaction. That means working with a user’s inputs, and a lot of these inputs are going to involve the use of buttons. But <a> tags and <button> tags can be pretty plain and ugly looking. That’s why in…
-
Create a Dynamic Select Tag for Your Model-Based Form in Ruby on Rails
I was writing an app that had a post model. The post model belongs to a “type.” In order to create my form for my post model, I needed to create a dynamic select field with my options coming from my type model. Here’s how I did that. First, in my controller, I got my…
-
How to Write Ruby Like a Pro – A Brief Styleguide
So you’ve been writing Ruby for a while. Maybe you’re familiar with control flow, data types, and the overall way to work with Ruby. Before you start writing large programs or before working with others, it’s important that your code is consistent and sticks to a single style. In this article, I’m going to give…
-
How to set up React.js with a Ruby on Rails Project Part 3 – CRUD
Welcome to part 3 of my React on Ruby on Rails (React on Rails?, RX3?, RoRoR?). Today, we’re going to add CRUD functions to our app. We already have it set up on the backend, now we just need to connect our frontend. This should be relatively easy. Here is the code for our api…
-
A Simple CSS Trick to Instantly Make a Site Responsive Without Having a Ton of Code in Your Media Queries
Hey, Josh here again. Lately, I’ve been showing you how to build projects with Ruby on Rails and React.js. Today, I’m going to show you something a little bit different – how to easily make your website responsive. If you’ve written any CSS for responsive websites, then you know how much of a pain it…
-
Using the useState Hook and Working with Forms in React.js.
Forms are the backbone of the Internet. Without them, it would be pretty difficult to make pass information between web pages. Luckily, working with forms in React.js is pretty easy. Let’s build a basic form today using a functional component and using the useState hook. First let’s make a simple form in React. Is this…
-
How to set up React.js with a Ruby on Rails Project Part 2 – Redux
Previously, we set up our Ruby on Rails app to use React. Now, we need to do a few more things to make sure our app is really functional. We still have to Set up our model in rails Have our frontend connect to our backend Integrate Redux so React works better. Let’s get started.…
-
Working With String In Ruby – All the Important Methods You Need to Know
Working with strings is one of the most common things you’ll do when working with Ruby or Ruby on Rails. Luckily, Ruby has all sorts of great built-in methods that help us work with strings. I put together this guide so you know what methods are available to you when working with strings in Ruby.…
-
How to set up React.js with a Ruby on Rails Project
Ruby on Rails is such a wonderful framework to work with. However, using Embedded Ruby (.erb) and ajax to build apps with dynamic frontends can be pain. And that’s where front-end frameworks like React, Angular, and Ember come in. Since React is the hot thing right now, we’re going to use it. But how to…