Comments (5)
You're right this is a bug and it's been around from the beginning. Your first syntax with the 'nil' attribute should work as expected. I'll look into it and hope to fix it soon, thanks!
from best_in_place.
Any update on this?
from best_in_place.
Bump. I originally logged #6 and a fix would be awesome. My users still have to edit the record when there is a nil value.
from best_in_place.
Here is an example:
When displaying this record:
Case id: 4, name: "bug record.", contact_id: 2, owner_id: nil
Here is my usage:
<%= best_in_place @case, :owner_id, :type => :select, :collection => User.all.map { |e| [e.id, e.name] } %>
The in place edit field is not displayed.
I even tried this:
<%= best_in_place @case, :owner_id, :type => :select, :collection => ["", "None"] + User.all.map { |e| [e.id, e.name] } %>
But it still fails.
from best_in_place.
Seems to work now. I had to use '' instead of nil for the lack of value, otherwise when the no-value option was selected the select box did not go away (but changes were applied to the model).
from best_in_place.
Related Issues (20)
- Rails 6 deprecation warnings
- undefined method `service_path' when adding best_in
- editing an item in a jsonb column
- undefined method `service_path' when adding best_in_place
- bip_text Test Helper datapicker MiniTest failure
- How to select foreign_key using friendly_id's hash_id?
- BestInPlaceEditor is not defined HOT 1
- Still okay to use? HOT 1
- Usage in Rails 6 HOT 28
- Rails 6 Deprecation warning
- Textarea not working HOT 1
- Rails 6 deprecation warning HOT 4
- How do differ best_in_place xhr request from othes?
- Project status HOT 6
- ActionView::Template::Error (wrong number of arguments (given 1, expected 3..4)) with cancan
- update is sent even though no change is made
- Render partial not working in ajax:success
- Release a new version, please HOT 2
- ignore this
- Add Ruby 3.2 support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from best_in_place.