Druid Druid - 1 year ago 116
Ruby Question

rails_admin: id field clickable and redirect to the show

the question seems naive but I'm new to rails admin

I need to make the id column clickable, so when I click on the object's id I can be redirected to the show action

enter image description here

Answer Source

Someone answered my issue on Github , here is the link

it can be done like that

config.model Booking do
    list do
      field :id do
        formatted_value do
          path = bindings[:view].show_path(model_name: 'Booking', id: bindings[:object].id)
          bindings[:view].link_to(bindings[:object].id, path)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download