No commit activity in last 3 years
No release in over 3 years
Toggle autocomplete on forms.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 3.1
 Project Readme

No Autocomplete Rails

Gem Version

jQuery plugin packaged in a gem to disable/enable autocomplete on forms. Works with rails simple_form not disabling autocomplete.

Installation

Add this line to your application's Gemfile:

gem 'no-autocomplete-rails'

And then execute:

bundle install

Add to your application.js file:

//= require no-autocomplete-rails

Usage

To disable on document ready. Just add no_autocomplete: ""

SimpleForm Example:

<%= f.input :subject, input_html: { no_autocomplete: "" } %>

Target certain elements

<%= f.input :subject, input_html: { id: "form-subject-input" %>
// Turn on
$("#form-subject-input").noAutocomplete();

// Toggle off
$("#form-subject-input").noAutocomplete({toggle: "off"});

// Toggle on
$("#form-subject-input").noAutocomplete({toggle: "on"});

Non-Rails

Just copy the no-autocomplete-rails file from lib/assets/javascripts to wherever you want it.