Currently I am working on a project in rails 4 in which I have a user-page at example.com/username but it only finds the record if i use username in proper case, how can I p
You can use Arel Tables.
# Suppose the target username in DB is 'FooBAR'. t = User.arel_table @user = User.find_by(t[:username].matches 'foobar')
This will find users with usernames like 'FooBar', 'foobar', 'FOOBAR' and so on.
More details here: https://github.com/rails/arel.