Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Viewing all articles
Browse latest Browse all 4623

Attempting to link projects to show

$
0
0

I have a list of projects, and I try to make an each do in which each of them should lead to its own project, but instead I get an error 'unexpected keyword_ensure', expecting end-of-input, however, I keep checking them all and none seems to be missing.

</div><h1 id=title>Projects</h1><div id="post_wrap" class="skiny_wrap"><% @projects.each do |project|  %><div class="post"><h2 class="name"><%= project.name %> </h2><p class="description"><%= project.description %> </p><% if project.has_photo? %><%= link_to project.name, project do %><div class="img_container" style="background-image: url(/photo_store/<%=project1.id%>.<%=project1.extension%>)"></div><% end %><%else%><p> theres nothing here </p><%end%><p class="category"><%= project1.category %> </p><p class="date"><%= project1.created_at.strftime('%A, %B %d') %> </p><hr></div><%end%><% end %></div>

What is going wrong? I can imagine one, is that that is not how you are meant to link to show however it is what my investigation lead to, please help me out.

<br><br><h2><%=@project.name%></h2><br><%=@project.link%><br><br><%=@project.description%><br><br>    Theme: <%=@project.category%><br><br><%= link_to "Edit", edit_post_path(@project) %><%= link_to "Delete", post_path(@project), method: :delete, data:{ } %>

That is the Erb to the show, as you can see is very simple.


Viewing all articles
Browse latest Browse all 4623


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>