railsadminteam / rails_admin

RailsAdmin is a Rails engine that provides an easy-to-use interface for managing your data
MIT License
7.89k stars 2.26k forks source link

Routing docu improvements #2687

Closed ain closed 7 years ago

ain commented 8 years ago

Current Using RailsAdmin routes should be improved.

Situation:

  1. Create model Kaboom with field kaboom:integer
  2. Configure model for linkage:

    configure :kaboom do
     pretty_value do
       if value.present?
          linked_kaboom = Kaboom.find(value)
          unless linked_kaboom.nil?
            bindings[:view].link_to(linked_kaboom.title, bindings[:view].rails_admin.kaboom_path(linked_kaboom))
          end
       end
     end
    end

What happens:

undefined method `kaboom_path' for #<ActionDispatch::Routing::RoutesProxy:0x000000059894f0>

What's the right path reference in the above scenario?

Version under question: eefa8ac

mryurii commented 8 years ago

@ain You mixed up approaches from documentation:

ain commented 8 years ago

Excellent! Thanks for the support @mryuriy.

I think the points you made here would be of great help in the docu.

thedanielhanke commented 7 years ago

@ain can this be closed?