Isuggest
This gem generates a list of suggested name/ email if there already exists a value in the DB. This could be user in signup pages when new user creates an account if the email/username is not unique we provide suggesstions
Installation
Add this line to your application's Gemfile:
gem 'isuggest'
And then execute:
$ bundle
Or install it yourself as:
$ gem install isuggest
Usage
In the model just add the below line
suggest_me :on => ['name']
Options available
suggest_me :on => ['name'], :seperator => '_', :total_suggestions => 5
Example
class User
suggest_me :on => ['name']
end
new_user = User.new('NewUser')
new_user.suggestions # returns arrays of result like ['NewUser1', 'NewUser_2', 'NewUser12', NewUser_1]
TODO:
- Allow users to specify multiple columns in the "on" option
Contributing
- Fork it ( https://github.com/roshandevadiga/mycodes/isuggest/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request