Limiting silver-searcher to only search specific file types

Solution 1:

Succintly,

ag active_record --ruby

Also you can use:

ag --list-file-types to list the supported file types

Otherwise you can limit by extension (also for unknown filetypes) by providing a regex as follows:

ag -G'\.rb$' active_record

Edited due to correction by bobbaluba