I Wanna Test View *_path on My Rails Console(pry), So What Should I Do?

Just do

1
2
3
4
5
pry(main)> include Rails.application.routes.url_helpers

pry(main)> admin_customer_path(User.first)
User Load (0.3ms)  SELECT  `users`.* FROM `users`  ORDER BY `users`.`id` ASC LIMIT 1
=> "/admin/customers/1"

enjoy!

このエントリーをはてなブックマークに追加