-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Problem with impressionist gem #1315
Comments
This appears to be related to #1185, and I can reproduce the problem for this time. |
Thanks for the update @mshibuya |
This is initialization order problem. When using Impressionist(or Rolify) without RailsAdmin, app's initialization process should look like:
But, after the installation of RailsAdmin:
so gives the error. For workaround, you can eliminate reference of model classes from class User < ActiveRecord::Base
...
rails_admin do
field :name, ...
end
end But to solve this fundamentally, I need to be more familiarized with Rails initialization process. |
Any update on this? No luck moving my configuration to the model. |
Can you paste your RailsAdmin initializer here? |
config.model User do
object_label_method do
:custom_label_method
end
list do
items_per_page 100
field :id
field :name do
formatted_value do
bindings[:view].tag(:img, { :src => bindings[:object].photo_url(:icon32) }) << " " << value
end
end
field :email
field :sign_in_count
end
end |
I'm guessing "list" doesn't work in a model definition. Any other ideas? |
What "doesn't work" means? And I need full content of RailsAdmin initializer, not only |
RailsAdmin.config do |config|
config.current_user_method { current_user }
config.main_app_name = ['The Transfer Station', 'Admin Dashboard']
config.authorize_with :cancan, AdminAbility
config.model User do
object_label_method do
:custom_label_method
end
list do
items_per_page 100
field :id
field :name do
formatted_value do
bindings[:view].tag(:img, { :src => bindings[:object].photo_url(:icon32) }) << " " << value
end
end
field :email
field :sign_in_count
end
edit do
exclude_fields :password, :password_confirmation, :reset_password_sent_at, :remember_created_at, :sign_in_count,
:current_sign_in_at,
:last_sign_in_at,
:current_sign_in_ip,
:last_sign_in_ip,
:confirmation_token,
:confirmed_at,
:confirmation_sent_at,
:coaching,
:speaking
end
end
config.model Course do
list do
items_per_page 100
field :id
field :title
field :user
field :trainer
field :hub
field :category_and_region
field :starts_at
field :status
end
edit do
exclude_fields :tags, :to_delete_published, :latitude, :longitude, :gmaps,:bookmarkables, :orders
end
end
config.model Hub do
list do
items_per_page 100
field :name do
formatted_value do
bindings[:view].tag(:img, { :src => bindings[:object].logo_url(:icon32) }) << " " << value
end
end
field :email
field :address
field :website
end
edit do
exclude_fields :hub_members, :trainers, :administrators, :primary_administrators, :bookmarkables
end
end
end |
I've just tried again and moving configurations to model classes works. |
Does this help at all? |
Yeah, as described at the top of #1428, as long as you use |
Now we have:
|
did you want me to setup a fresh rails project for you to test this with? |
I'm sorry for being away from here. |
Well, it seems to be fixed? Working repo: |
I'm having this same problem with the latest version of impressionist and rails admin as described here - http://stackoverflow.com/questions/24183344/conflict-between-rails-admin-and-impressionist-gems . I've tried the solutions mentioned here but still no luck - any ideas? It simply won't initialize when I have 'is_impressionable' in my model, so I have to keep commenting it out whenever I want to restart the server or generate a migration etc |
If I try to use the impressionist gem with rails_admin, I get this:
Is this a rails_admin issue or impressionist issue?
Gem home is https://github.com/charlotte-ruby/impressionist
The text was updated successfully, but these errors were encountered: