Rails Associations

An association is a connection between two Active Record models. It makes it much easier to perform various operations on the records in your code. We will divide associations into four categories:

One-to-One
One-to-Many
Many-to-Many
Polymorphic One-to-Many

If you are new to Ruby on Rails, be sure to get up your rails project ready and check how to create models in Rails.

Link: https://dzone.com/articles/rails-associations?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

Go vs. Ruby on Rails

Ruby Performance:
Almost all of our clients complained about slow performance in their Ruby apps; which was leading to concurrency bottlenecks. This hits performance and the time it took to complete a job was not satisfactory. In contrast, Golang was able to handle a huge load of concurrent requests without slowing down the performance of a program. This is why enterprises with web-based applications, found that Golang based programs were able to handle several users at one time without ever underperforming.
Scalable:
Scalability is almost always a result of concurrency. An application which can handle concurrent requests is more likely to be scalable. We realized when Rails gets to a significant enough scale, the runtime speed diminishes significantly, resulting in poor performance. Golang, on the other hand, outshines this test by scaling automatically to multiple cores. This ensures that organizations don’t have to worry about migrating costs once the business scales up.

Link: https://dzone.com/articles/go-vs-ruby-top-golang-web-development?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

How to Implement a Ruby Hash Like Grammar in Parslet, Part 2

Welcome back! If you missed Part 1, you can check it out here.
Transformers – Abstract Syntax Trees in Disguise
I mentioned transformers previously, but they’re such an abstract concept that it helps to look at an example. Think of them as a way to reduce leaf nodes on our tree so that they make more sense. One way to represent our current parse tree is this:

Link: https://dzone.com/articles/how-to-implement-a-ruby-hash-like-grammar-in-parsl-1?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

How to Implement a Ruby Hash Like Grammar in Parslet, Part 1

Before you can understand how to build a parser using parslet, you need to understand why you might want to. In my case, I have a library called rundoc, it allows anyone to write documentation that can be “run." For example, someone might write docs that had this:
“`
:::>> $ rails -v
“`
Then in your documentation output, you would get this result:

Link: https://dzone.com/articles/how-to-implement-a-ruby-hash-like-grammar-in-parsl

Opal – Ruby on JavaScript VM – What’s Still Missing

JavaScript VMs are everywhere, and environments running them such as browsers and phones look likely to remain the dominant way for users to interact with software for a very long time. This led to an explosion in the popularity of JavaScript – the native language of that environment.
But JavaScript is a dreadful language. It started a dirty hack, which just so happened to be positioned right and benefited from browsers becoming the universal user interface. It can’t even ever get properly fixed like, let’s say, Python 1, due to unique backward compatibility cost.

Link: https://dzone.com/articles/opal-ruby-on-javascript-vm-whats-still-missing

RSpec Rails Controller Test

Rails is a web development framework, where model, view, and controller are important aspects of your application. Controllers, just like models and viewers, need to be tested with the Ruby community’s favorite tool, RSpec.
Controllers in Rails accept HTTP requests as their input and deliver back and HTTP response as an output.

Link: https://dzone.com/articles/rspec-rails-controller-test?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

Rails Bundle Install and Gemfile

Bundler makes sure that Ruby applications always use the exact gems and versions that you need while keeping a consistent environment and gem dependencies satisfied. This is done by ensuring that the gems you need are present in the development, staging, and production stages.
Setting Up a Bundler
With these three simple steps that every beginner should know to get your application up and running with bundler:

Link: https://dzone.com/articles/rails-bundle-install-and-gemfile-1?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

Pipelines on a Rails Environment With react_on_rails and Webpack

I noticed a bit of a gap when it comes to documentation and setting up Bitbucket Pipelines when you have some modern webpack dependencies with yarn.
If you’ve gone through this process, you may have struggled to find helpful documentation, too. I thought it may be useful to walk through some of the basics of how Bitbucket Pipelines is set up and strategies to help debug your pipeline’s configuration. Read on for my experience of going through the process of setting up Bitbucket Pipelines on a Rails 5.2 environment.

Link: https://dzone.com/articles/how-to-set-up-bitbucket-pipelines-on-a-rails-52-en?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev