In my index.html.erb file, I have:
<% @posts.each do |post| %> <%= post.title %> <%= link_to 'Show', post %> <% end %>
How can I refer to the show action, but having <%= post.title => as the link name?
I tried <%= link_to '<%= post.title %>', post %> , but it does not work. Am I missing something or do I need to change something?
source share