-
Notifications
You must be signed in to change notification settings - Fork 137
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
Doesnt work with Rails_admin gem #89
Comments
Please could you share a little more context / code? What are you trying to delete, and how? Via the rails_admin UI? |
Please check the screenshot |
@bhushangahire did you find the fix?? |
I fixed it by overriding app/views/rails_admin/main/_delete_notice.html.erb by putting following contents <% object = delete_notice %>
<li style="display:block; margin-top:10px">
<span class="label label-default">
<%= @abstract_model.pretty_name %>
</span>
<% wording = object.send(@model_config.object_label_method) %>
<% if show_action = action(:show, @abstract_model, object) %>
<%= link_to(wording, url_for(action: show_action.action_name, model_name: @abstract_model.to_param, id: object.id), class: 'pjax') %>
<% else %>
<%= wording %>
<% end %>
<ul>
<% @abstract_model.each_associated_children(object) do |association, children| %>
<% humanized_association = @abstract_model.model.human_attribute_name association.name %>
<% limit = children.count > 12 ? 10 : children.count %>
<% children.first(limit).each do |child| %>
<%= content_tag :li, class: dom_class(child) do %>
<% if child.class.name != "RailsSettings::SettingObject" %> #condition added
<% child_config = RailsAdmin.config(child) %>
<%= humanized_association.singularize %>
<% wording = child.send(child_config.object_label_method) %>
<% if child.id && (show_action = action(:show, child_config.abstract_model, child)) %>
<%= link_to(wording, url_for(action: show_action.action_name, model_name: child_config.abstract_model.to_param, id: child.id), class: 'pjax') %>
<% else %>
<%= wording %>
<% end %>
<% end %>
<% end %>
<% end %>
<% if children.count > limit %>
<li>
<%= t('admin.misc.more', count: children.count - limit, models_name: humanized_association) %>
</li>
<% end %>
<% end %>
</ul>
</li> |
Version 2.5.0 doesn't work with RailsAdmin. It fails as soon as you try viewing any model that uses Returned error and stacktrace: Error: undefined method `constantize' for nil:NilClass Stacktrace: ledermann-rails-settings (2.5.0) lib/rails-settings/setting_object.rb:78:in |
Any workaround to get delete working with rails admin gem.
Its trying to find relation but breaks
undefined method
constantize' for nil:NilClass`The text was updated successfully, but these errors were encountered: