Skip to content

Commit

Permalink
Article listing was created
Browse files Browse the repository at this point in the history
  • Loading branch information
tayfunoziserikan committed Aug 17, 2014
1 parent ce62f4f commit 7c5f025
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/controllers/articles_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
class ArticlesController < ApplicationController

def index
@articles = Article.all
end

def show
@article = Article.find(params[:id])
@article = Article.find(params[:id])
end

def new
Expand Down
15 changes: 15 additions & 0 deletions app/views/articles/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<h1>Listing Articles</h1>

<table>
<tr>
<th>Title</th>
<th>Text</th>
</tr>

<% @articles.each do |article| %>
<tr>
<td><%= article.title %></td>
<td><%= article.text %></td>
</tr>
<% end %>
</table>

0 comments on commit 7c5f025

Please sign in to comment.