We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to keep compact_show_view = true, which I understand to be defined as "anything non-nil should show up in show view"
compact_show_view = true
I have a boolean field, and thus I want it to show up in show view when it is set to false:
false
> false.nil? => false
The show template does properly use #nil? as the check for whether or not to display values:
#nil?
- unless values[index].nil? && RailsAdmin::config.compact_show_view
The problem is that the values array is constructed by calling #presence on the formatted_value:
values
#presence
formatted_value
values = fields.map{ |f| f.formatted_value.presence }
Unfortunately,
> false.presence => nil
so
> false.presence.nil? => true
The text was updated successfully, but these errors were encountered:
👍 for this.
As an additional argument for this being considered a bug, we have a pretty_value defined for the boolean field type at https://github.com/sferik/rails_admin/blob/master/lib/rails_admin/config/fields/types/boolean.rb#L13
pretty_value
register_instance_option :pretty_value do case value when nil %(<span class='label label-default'>‒</span>) when false %(<span class='label label-danger'>✘</span>) when true %(<span class='label label-success'>✓</span>) end.html_safe end
Sorry, something went wrong.
18d072c
No branches or pull requests
I want to keep
compact_show_view = true
, which I understand to be defined as "anything non-nil should show up in show view"I have a boolean field, and thus I want it to show up in show view when it is set to
false
:The show template does properly use
#nil?
as the check for whether or not to display values:The problem is that the
values
array is constructed by calling#presence
on theformatted_value
:Unfortunately,
so
The text was updated successfully, but these errors were encountered: