Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

moved index logic into a partial and completed pagination. Also turne…

…d the fetch tweet link to a button.
  • Loading branch information...
commit 9ee5d5381c07d9df9c167f1a9215f33f3a03c707 1 parent 888bb58
@aboutaaron authored
View
2  app/assets/javascripts/tweets.js.coffee
@@ -1,3 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
-# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
View
5 app/assets/stylesheets/application.scss
@@ -77,4 +77,9 @@ footer {
color: $red;
font-size: 1.3rem;
text-decoration: underline;
+}
+
+.pagination {
+ display: inline-block;
+ float: right;
}
View
4 app/views/tweets/_tweets.html.erb
@@ -0,0 +1,4 @@
+<% @tweets.each do |tweet| %>
+ <li>
+ <span id="user"><%= hyperlink_the_tings("@#{tweet.user}") %></span> <span id="content"><%= hyperlink_the_tings(tweet.content) %></span> (<span id="tweet-id"><%= tweet.tweet_id %></span>)</li>
+<% end %>
View
10 app/views/tweets/index.html.erb
@@ -1,11 +1,7 @@
<div class="span6 offset3">
- <ul class="unstyled">
- <% @tweets.each do |tweet| %>
- <li>
- <span id="user"><%= hyperlink_the_tings("@#{tweet.user}") %></span> <span id="content"><%= hyperlink_the_tings(tweet.content) + " (#{tweet.id})" %></span> (<span id="tweet-id"><%= tweet.tweet_id %></span>)</li>
- <% end %>
+ <ul class="unstyled" id="tweets">
+ <%= render "tweets" %>
</ul>
+ <%= link_to 'Fetch a new tweet!', new_tweet_path, :class => 'btn btn-large' %>
<%= will_paginate @tweets %>
-
- <%= link_to 'Fetch a new tweet!', new_tweet_path %>
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.