Blog
In your Vue application, you need to validate the numbers with decimal points. For example, price of a product you can use the following method. I am using VeeValidate module for this First you have to install the VeeValidate lib for this You can run the NPM command to install this npm install vee-validate –save […]
You can develop multi tenant application very easily with Ruby on Rails You can use the gem called apartment Multitenancy Crash Course: Multitenancy with the Apartment gem If you would like to learn more about Multi Tenancy Architecture you can visit this tutorial Three Database Architectures for a Multi-Tenant Rails-Based SaaS App
Write your first test @ test\first_test.rb
1 2 3 4 5 6 |
require "minitest/autorun" class ExampleTest < Minitest::Test def test_truth assert true end end |
Now you can run this test on your terminal ruby first_test.rb at
Behavior Driven Development (BDD) is a software development process -This is somewhat similar to Test Driven Development (TDD) -BDD starts with natural language to describe system so that every one involved in the development, can understand it
In following Youtube series you can learn the the TDD with Laravel Part 1 Introduction, PHPUnit Setup & Books Test Part 1 Part 2 Deleting a Record, Asserting Instance Of & Carbon Parse Part 3 Implementing a firstOrCreate Author Record With TDD Part 4 Book Checkout & Book Checkin Flow With TDD
In this tutorial we will see how you can authenticate the RUBY on Rails application with Devise gem Devise Step 1 Add the following code to youe Genfile gem ‘devise’ Step 2 Next, you run the following command rails generate devise:install This will make your application ready for Device Some setup you must do manually […]
Rack is a Ruby replacement for CGI Rack sits between Rail Framework and the Web Server So Rack provides you minimal,modular and adaptable interface for developing web applications
How to create a model rails g model category category_name I want to create Product and Category models. Product model has a reference to Category model So I first create the model Category
1 |
rails g model category category_name |
Your migrated file @db\migrate location
1 2 3 4 5 6 7 8 9 |
class CreateCategories < ActiveRecord::Migration[6.0] def change create_table :categories do |t| t.string :category_name t.timestamps end end end |
and then run the migrate
1 |
rake db:migrate |
Second I will create the Product
1 |
rails g model product product_name sku category:references |
You can […]
To install rails on your Mac computer, you can use the following command >sudo gem install rails Create the Rail project with MYSQL database support >rails new MyProject -d mysql What is Bundle in your Rails project? Bundle is separate gem for Rails Bundle manage the gems which your Rail application need It tracks and […]