User view lesson filter words

This is my code which I did on my holiday, and I did not yet pull request.
And I am very sorry about many commit on this pull request because I don't know how to remove that commit after I rebase each of them in to one.
where condition must be written in a scope
please search about Rails scope