Question

I'm having trouble configuring the fields of my models.

I can change the name of the label as directed here: https://github.com/sferik/rails_admin/wiki/Railsadmin-DSL

But when I do that I lose the habtm fields.

Here is the code I have for my Post Model BEFORE changing the field label

config.model Post do
  weight 1
  label_plural "Aktuelles"
  label "Aktuelle"
  include_all_fields
  exclude_fields :created_at, :tag_list, :post_type, :post_tag_list, :slug
  field :body do
    ckeditor true
  end
end

and here is what the habtm Page model relationship looks like when editing a Post. enter image description here

Now I want to change the "Pages" field label to "Seiten".. and I try like this

config.model Post do
  weight 1
  label_plural "Aktuelles"
  label "Aktuelle"
  include_all_fields
  exclude_fields :created_at, :tag_list, :post_type, :post_tag_list, :slug
  
  field :page_ids do
    label "Seiten"
  end

  field :body do
    ckeditor true
  end
end

and get this in the UI

enter image description here

How can I change the "Pages" label to "Seiten" without this side effect?

Thanks in advance for your help and time!

Was it helpful?

Solution

instead of page_ids

# remove below line
field :page_ids do
  label "Seiten"
end

# Add this
field :pages do
 label "Seiten"
end
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top