1

In one of my ActiveAdmin pages I have fields containing a URL (either https: or file:). How can I make that when clicked on a new browser tab opens with the corresponding content ? I tried

link_to('site web', :siteWeb)

but the result is an error message:

undefined method `siteWeb_path' for #<#<Class:0x00007f048201edb0>:0x00007f048202f700>
Roman Alekseiev
  • 1,854
  • 16
  • 24

1 Answers1

0

The problem here is your using a path helper that isn't defined in your routes.rb file. There's an easy way to see what the right path helper is though, just go to your terminal and run:

rails routes

You'll get a bunch of information about each route, along with the specific name of the route path helper function defined in Rails. Then you can just use it like so: https://apidock.com/rails/ActionView/Helpers/UrlHelper/link_to

sevensidedmarble
  • 643
  • 1
  • 4
  • 14
  • Sorry I' lost. My understanding is that paths and routes are related to Rails _resources_ that are related to _models_. But what I am trying to do in the _show page_ of one of my resource is just a stupid reference to something like `www.google.com` (ore more reasonable `https://www.youtube.com/watch?v=z8YB47by5g4`). – Beat Michel Apr 14 '20 at 16:28