I am using the Best In Place gem.
This is an example of my object:
<h5><%= best_in_place node, :name, as: :input, activator: "#edit-node-title-#{node.id}" %> <%= link_to "<i class='fa fa-pencil'></i>".html_safe, "#", id: "edit-node-title-#{node.id}" %></h5>
But what I want to do is have the node.name
attribute be shown as a regular link.
So just link_to node.name, node
.
How do I combine the two?
Use the display_with
option? It takes a helper or proc. I would prefer a helper, but for brevity I show it with a proc:
<%= best_in_place node, :name, as: :input,
activator: "#edit-node-title-#{node.id}"
display_with: proc{|node| link_to node.name, node_path(node) }
%>
<%= link_to "<i class='fa fa-pencil'></i>".html_safe, "#", id: "edit-node-title-#{node.id}" %>