bernat / best_in_place

A RESTful unobtrusive jQuery Inplace-Editor and a helper as a Rails Gem
http://blog.bernatfarrero.com/in-place-editing-with-javascript-jquery-and-rails-3/
1.2k stars 574 forks source link

Added ability to use different input types #544

Open damisul opened 8 years ago

damisul commented 8 years ago

HTML5 introduced new handy input types like number, url, etc. and some basic validations. I've tried to pass additional options to bip_helper in html_attrs params like

best_in_place item, :arrived, html_attrs: {type: :number, min: 0, max: 100, step: 1, required: true} but got javascript errors.

I've checked sources and see that input editor assumes that input always has 'text' type. I've modified javascript to allow other input types.

now it works for me

damisul commented 8 years ago

Also there were rspec failures in rails-4.2 enviroment. If I understand correctly, they were caused by sprocked v3.0 I've tried to fix them, not sure if everything is ok though

nxdefiant commented 6 years ago

I wonder why this havn't been merged yet, also duplicate of #551

KenneyE commented 5 years ago

This would be very helpful. Anything we can do to get this moved forward?

0agautam commented 3 years ago

Thanks this post helped me a lot and i made the changes in my best_in_place.js file according to your commit and my code is successfully working :+1: https://github.com/bernat/best_in_place/pull/544/commits/48465455edf2b2aab6ea122410425046e7eff526