Is it possible to use a input as the path of a "link_to"?
<% @call.each do |call| %>
<%= call.title %>
<%= link_to "Path Text", call_path(call) %>
<% end %>
The above code will go to the call show page. If in the create form I have a input for the path
and it is a string
. Is it possible to enter "call_path(call)" and then use that input as the link_to
path, eg:
<% @call.each do |call| %>
<%= call.title %>
<%= link_to "Path Text", call.path %>
<% end %>
I have tried this code and the link outputs as a link with the url of "call_path(call)"
In the call model I have defined path:string
when I created the model and I have :path
in the permit statement of the params
in the controller.