Last active
June 3, 2016 19:54
-
-
Save JoeyBy/b18ae0cf06627758e1d93f6ba9815173 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section> | |
<!--creates an <a> tag around the text "new task" and points it to eh new_task_path defined in our routes --> | |
<%= link_to "new task", new_task_path %> | |
<!--loops through each of the tasks returned from the database and passed to the view from the tasks_controller index action --> | |
<% @tasks.each do |task| %> | |
<!-- for each task put the title in an h3 tag --> | |
<h3><%= task.title %></h3> | |
<!-- for each task put the description in a p tag --> | |
<p><%= task.description %></p> | |
<!-- for each task add a delete button that uses the DELETE Http method (GET is default for link_to helper methods) --> | |
<%= link_to "delete", task_path(task), method: :delete, data: {confirm: "Are you sure?"} %> | |
<% end %> | |
</section> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment