-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Using RailsAdmin routes
Abhishek Srivastava edited this page Jul 9, 2020
·
9 revisions
rails_admin.dashboard_path
...
rails_admin.index_path('module~class_name')
rails_admin.new_path('module~class_name')
...
rails_admin.show_path(model_name: 'blog~post', id: post.id)
rails_admin.edit_path(model_name: 'blog~post', id: post.id)
...
Namespaced models must use a '~' between modules and class name.
main_app.article_path(my_article)
# from a config block:
bindings[:view].main_app.article_path(my_article)
# from a config block:
bindings[:view].link_to('new record', bindings[:view].rails_admin.new_path('module~class_name'))
# Eg.
field :custom_action do
formatted_value do
bindings[:view].link_to('new record', bindings[:view].rails_admin.new_path('module~class_name', key: 'value'))
end
end