In the previous part of React JSX series, we took a look at how to correctly loop through arrays and objects in React. In this article, we'll help you learn how to write conditional statements when rendering components.

Everything below applies to React Native as well!

Kolosek 發表在 痞客邦 留言(0) 人氣()

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 the production.

Setting up a bundler

With this three simple steps you will get your application up and running with bundler:

Kolosek 發表在 痞客邦 留言(0) 人氣()

If you are new to writing RSpec tests in Rails using FactoryGirl (bot), you can ask yourself what is the difference between createbuild and build_stubbed. In this article, we will do our best to help you understand them better.

Let's say we are testing a valid profile creation:

Kolosek 發表在 痞客邦 留言(0) 人氣()

Usually, when developing a website, you'll need some dynamical rendering, like a listing of items, showing some element under a certain condition and so on.
You're all aware of the standard JS syntax - a  for loop, or an if / else  - but when you try to write those under a render method in React, you'll most likely get some weird looking errors.

Kolosek 發表在 痞客邦 留言(0) 人氣()

RSpec is an awesome tool for testing Rails apps. It is a hugely popular BDD-oriented (Behavior Driven Development) testing framework in the Ruby community.

It makes writing tests simpler, more expressive and easier to maintain!

Kolosek 發表在 痞客邦 留言(0) 人氣()

Scaffolding in Ruby on Rails refers to the auto-generation of a set of a model, views and a controller usually used for a single database table.

For example, you can auto-generate a ready to use controller, model, and views with a full  CRUD (Create,  Read,  Update,  Delete) web interface for the Story table using the following command:

Kolosek 發表在 痞客邦 留言(0) 人氣()

Rails redirect_to takes two parameters, option and response_status  (optional). It redirects the browser to the target specified in options.

This parameter can be:

文章標籤

Kolosek 發表在 痞客邦 留言(0) 人氣()

Instead of writing a JavaScript application for working remote modals in your Rails application, it is a much more simple approach to render our views on a server and display them as modals. In this tutorial, we will explain how to implement this by using Bootstrap modals.

Step 1: Initial setup

Add gem 'bootstrap'  and gem 'popperjs'  to your gemfile.

文章標籤

Kolosek 發表在 痞客邦 留言(0) 人氣()

This is a complete tutorial for creating join table in Ruby on Rails. It will show you how to:

  • generate the model,
  • address associations and
  • join table model.

Also, it will show you how to write a form with multiple select boxes and how to handle it in the controller.

文章標籤

Kolosek 發表在 痞客邦 留言(0) 人氣()