Comments (6)
Please could you share a little more context / code?
What are you trying to delete, and how? Via the rails_admin UI?
from rails-settings.
Getting same error in rails 4.2 and rails_admin 1.3.0
from rails-settings.
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
from rails-settings.
@bhushangahire did you find the fix??
from rails-settings.
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>
from rails-settings.
Version 2.5.0 doesn't work with RailsAdmin. It fails as soon as you try viewing any model that uses has_settings
.
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 _target_class' ledermann-rails-settings (2.5.0) lib/rails-settings/setting_object.rb:82:in
_setting?'
ledermann-rails-settings (2.5.0) lib/rails-settings/setting_object.rb:28:in respond_to?' rails_admin (3.1.2) lib/rails_admin/config/model.rb:66:in
block (2 levels) in class:Model'
rails_admin (3.1.2) lib/rails_admin/config/model.rb:66:in each' rails_admin (3.1.2) lib/rails_admin/config/model.rb:66:in
detect'
rails_admin (3.1.2) lib/rails_admin/config/model.rb:66:in block in <class:Model>' rails_admin (3.1.2) lib/rails_admin/config/configurable.rb:77:in
instance_eval'
rails_admin (3.1.2) lib/rails_admin/config/configurable.rb:77:in block in register_instance_option' rails_admin (3.1.2) lib/rails_admin/config/lazy_model.rb:66:in
method_missing'
rails_admin (3.1.2) app/helpers/rails_admin/application_helper.rb:74:in wording_for' rails_admin (3.1.2) app/controllers/rails_admin/main_controller.rb:36:in
action_missing'
actionpack (7.0.6) lib/abstract_controller/base.rb:229:in _handle_action_missing' actionpack (7.0.6) lib/action_controller/metal/basic_implicit_render.rb:6:in
send_action'
actionpack (7.0.6) lib/abstract_controller/base.rb:215:in process_action' actionpack (7.0.6) lib/action_controller/metal/rendering.rb:165:in
process_action'
actionpack (7.0.6) lib/abstract_controller/callbacks.rb:234:in block in process_action' activesupport (7.0.6) lib/active_support/callbacks.rb:118:in
block in run_callbacks'
actiontext (7.0.6) lib/action_text/rendering.rb:20:in with_renderer' actiontext (7.0.6) lib/action_text/engine.rb:69:in
block (4 levels) in class:Engine'
activesupport (7.0.6) lib/active_support/callbacks.rb:127:in instance_exec' activesupport (7.0.6) lib/active_support/callbacks.rb:127:in
block in run_callbacks'
activesupport (7.0.6) lib/active_support/callbacks.rb:138:in run_callbacks' actionpack (7.0.6) lib/abstract_controller/callbacks.rb:233:in
process_action'
actionpack (7.0.6) lib/action_controller/metal/rescue.rb:23:in process_action' actionpack (7.0.6) lib/action_controller/metal/instrumentation.rb:67:in
block in process_action'
activesupport (7.0.6) lib/active_support/notifications.rb:206:in block in instrument' activesupport (7.0.6) lib/active_support/notifications/instrumenter.rb:24:in
instrument'
activesupport (7.0.6) lib/active_support/notifications.rb:206:in instrument' actionpack (7.0.6) lib/action_controller/metal/instrumentation.rb:66:in
process_action'
actionpack (7.0.6) lib/action_controller/metal/params_wrapper.rb:259:in process_action' searchkick (5.2.4) lib/searchkick/controller_runtime.rb:15:in
process_action'
activerecord (7.0.6) lib/active_record/railties/controller_runtime.rb:27:in process_action' actionpack (7.0.6) lib/abstract_controller/base.rb:151:in
process'
actionview (7.0.6) lib/action_view/rendering.rb:39:in process' actionpack (7.0.6) lib/action_controller/metal.rb:188:in
dispatch'
actionpack (7.0.6) lib/action_controller/metal.rb:251:in dispatch' actionpack (7.0.6) lib/action_dispatch/routing/route_set.rb:49:in
dispatch'
actionpack (7.0.6) lib/action_dispatch/routing/route_set.rb:32:in serve' actionpack (7.0.6) lib/action_dispatch/journey/router.rb:50:in
block in serve'
actionpack (7.0.6) lib/action_dispatch/journey/router.rb:32:in each' actionpack (7.0.6) lib/action_dispatch/journey/router.rb:32:in
serve'
actionpack (7.0.6) lib/action_dispatch/routing/route_set.rb:852:in call' railties (7.0.6) lib/rails/engine.rb:530:in
call'
railties (7.0.6) lib/rails/railtie.rb:226:in public_send' railties (7.0.6) lib/rails/railtie.rb:226:in
method_missing'
actionpack (7.0.6) lib/action_dispatch/routing/mapper.rb:19:in block in <class:Constraints>' actionpack (7.0.6) lib/action_dispatch/routing/mapper.rb:48:in
serve'
actionpack (7.0.6) lib/action_dispatch/journey/router.rb:50:in block in serve' actionpack (7.0.6) lib/action_dispatch/journey/router.rb:32:in
each'
actionpack (7.0.6) lib/action_dispatch/journey/router.rb:32:in serve' actionpack (7.0.6) lib/action_dispatch/routing/route_set.rb:852:in
call'
from rails-settings.
Related Issues (20)
- Administrate SelectField options being chached
- Unexpected behavior concerning 'default-settings' in class hierarchies (STI)
- I dont get it to work with dynamic settings HOT 4
- Settings keys cannot be a single character
- `default_settings` nested Arrays and Hashes are mutable
- Its throwing error while using the gem with a different table name with same fields as of settings table
- Typo in the md file
- Any way to pass in allowed classes so the YAML.load deserialize things saved before the Active Record update? HOT 3
- undefined method `timestamped_migrations' for ActiveRecord::Base:Class (NoMethodError) HOT 1
- Interest in RSpec matchers? HOT 2
- Migrate older settings in new format
- JSON column for `value`
- Accessing settings values as JSON??? HOT 1
- update settings with devise controller
- ActiveModel::Serializer::Null with Hash
- Default settings with a nested hash HOT 1
- Silent return of defaults if Rails not initialized HOT 1
- Default settings still working? HOT 3
- Active Admin
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 rails-settings.