Welcome to Railsguides
Web development technical challenges are solved here.
-
How to generate rake task
Ruby on Rails guides for generate rake task. If you want to write new rake task you can use rails generate task generator. It is Ruby On Rails generator which generates scaffold for the rake task
-
Improve code readability with closures in Ruby
Reduce Ruby code complexity code with closures.
-
Enums as constants in Ruby DSL
The post provides a DSL allows enums definition as constants.
-
Rails migration for belongs_to association with custom table name
How to write a Rails migration for a belongs_to association which name does not correspond to the joined table name.
-
From Single drop-down to Multiple check-boxes
This post describes an incremental process how to move from a belongs_to/has_many to has_and_belongs_to_many association for a Rails application in live with zero downtime.
-
Dry-struct use cases
This post describes dry-struct and dry-schema use cases, such as serialization/deserialization of data objects, form-objects params contract implementation, code documentation, etc.
-
Efficient algorithm to check dates overlap
Do you need an efficient algorithm that checks a date range overlapping with some denoted set of date ranges? This article explains how to solve this problem with a subtle approach.
-
Stub Rails ActiveRecord associations in your tests
Explains a technique that allows stubbing ActiveRecord associations easily so that your tests are getting faster.
-
Conditional execution with DSL in Ruby
This is a howto describing an alternative solution for if-clause in Ruby.
-
Polish Rails migrations
Sometimes, it's needed to re-run a new migration in a new pull request back and forth several times after code changes, rebasing and etc. The process gets annoying when there are many migrations in the PR and that one, that's being changed, is somewhere in the middle of the history. In this post there is a solution how to relieve the pain.
-
Travel in time during testing a Rails application
There will be explained how to test a Rails application when the current time change is needed every time. In other words how to travel in time and not corrupt your operating system.