Skip to content

jaypackard/jquery.rails-form-disabling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

If rails fashion, if a form field's name ends with [_destroy], then selecting the checkbox will set that field to 0 so as not to destroy the record.  Unselecting the checkbox will set that field to 1 to destroy the record.  However, if there is no value for a field ending with the name [id], then this is not stored in the database so there is no need to destroy this record, so it sets all the inputs to disabled to avoid posting the fields altogether. 

I couldn’t find support for this common case in rails. If there is support for this, please let me know.

Usage:
$('. rails_form_disabling’).rails_form_disabling();

About

Use this jQuery plugin to elegantly handle destroying underlying associated models stored in the database with a checkbox.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors