Tech

with_options in rails

I have recently encountered this method, which saved my time and helped me follow the DRY principle Use case: Consider a scenario, you have a list of trains and you have to apply filters on like depature_time, arrival_time, train_number, arrival_station, depature_station, number of coaches, etc. For that, you have to write interaction. The input will…