Closed TrevorHinesley closed 1 year ago
Thanks for the report!
Reproduced and will push a fix shortly
Fixed in https://github.com/tfwright/live_admin/commit/7660dc779dab546cfa79c109bf1b38b8452aa787
Note that only a value of false
will disable, as nil
will be interpreted as "missing/default"
Thanks a bunch!
Describe the bug Using v0.11.0, disabling certain verbs no longer works. For instance,
use LiveAdmin.Resource, create_with: false
oruse LiveAdmin.Resource, create_with: nil
does not remove the "New" button from the container component.After some snooping, I wonder if it's because this line changed recently (appearing to have fallbacks that are overriding a falsey value, which is the method that the container relies upon for conditional rendering).
The example app shows
create_with: nil
being used though, andcontainer.ex
compares explicitly tofalse
here, so that might have changed recently too.To Reproduce Simply insert
use LiveAdmin.Resource, create_with: false
oruse LiveAdmin.Resource, create_with: nil
, and "New" will still be clickable.In
iex
, this is what's returned for either value above:Since
container.ex
is checking forfalse
, that will always be true.Expected behavior I expect "New" to be hidden when
create_with: false
orcreate_with: nil
is used.Environment: