Skip to content
New issue

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

Feature: Models marked as readonly shouldn't allow save buttons in Edit view #1684

Closed
jc00ke opened this issue Jul 2, 2013 · 3 comments
Closed
Milestone

Comments

@jc00ke
Copy link
Contributor

jc00ke commented Jul 2, 2013

First, thanks, because rails_admin is awesome.

Business:
It would be nice if the rails_admin Edit view did not display the save buttons when model.readonly? # => true

selection_001

Right now if the model is readonly then an ActiveRecord::ReadOnlyRecord error is thrown when attempting to save.

selection_002

I might also expect that all form fields on such a model are automatically marked as read_only.

Thoughts? Thanks!

@combizs
Copy link

combizs commented Jul 17, 2013

Rails admin is such an awesome tool.

With regards to this issue, I would like to work on this. I installed it with a simple blog app and it works great. One thing I noticed is that if we disable the buttons, it would prevent the form from submitting. I would like to further enhance the user experience by fading-out the buttons on this page, along with other buttons/tabs on related pages as well. Attached contains multiple screenshots, pasted into one image, of the admin "dashboard" page, the "list of posts" page, and "details of post" page. The circles I drew on top of that layer describes the notion to disable the feature to avoid admin confusion.

Please let me know your thoughts. I am already starting to work towards a practical solution.

admin-rails-readonly-edit

@pducks32
Copy link

pducks32 commented Dec 1, 2014

So I would like to work on this because this feature would be really helpful for something I'm working on. As for the UX, I'm wondering what might be better. Not showing the buttons at all or having them disabled?

@mshibuya mshibuya added this to the 3.0.0 milestone Aug 8, 2021
@inopinatus
Copy link

This was an incomplete idea, because readonly? isn't forever and can be dynamic, including based on field values, which means you can edit it to not be read-only any more. In Rails it's only evaluated at the moment of save, but rails_admin has now made it matter at the moment of view.

Now I have to figure out how to tell rails_admin that it's okay to allow editing of a particular readonly? object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants