mardi 19 juin 2018

Don't find how to link to user_post

I'm new on rails, I work on a application. My user can create a post, posts belong to user. On my index user I want to link_to the user_post for each user, I try a lot of solution, but nothing work...

_list.html.erb :

<div id="filterrific_results">

<div>
  <%= page_entries_info users %>
</div>

<% @users.each do |user| %>
  <% if user.coach? %>
    <h1><%= user.fname %> <%= user.lname %></h1>
    <h2><%= user.mother_tongue %></h2>
      <center>
        <p><%= user.postal_code %> <%= user.locality %></p>

        <p><%= link_to "En savoir plus", **user_post_path** %></p>
      </center>
  <% end %>
<% end %>
</div>


<%= will_paginate users %>

Aucun commentaire:

Enregistrer un commentaire