about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/streams_controller.rb1
-rw-r--r--app/views/streams/_stream.html.haml8
2 files changed, 7 insertions, 2 deletions
diff --git a/app/controllers/streams_controller.rb b/app/controllers/streams_controller.rb index 664f533..9b7588c 100644 --- a/app/controllers/streams_controller.rb +++ b/app/controllers/streams_controller.rb
@@ -2,6 +2,7 @@ class StreamsController < ApplicationController
2 2
3 def show 3 def show
4 @stream = Stream.find_by_slug(params[:slug]) 4 @stream = Stream.find_by_slug(params[:slug])
5 @updates = @stream.updates.paginate(page: params[:page], per_page: 10)
5 end 6 end
6 7
7end 8end
diff --git a/app/views/streams/_stream.html.haml b/app/views/streams/_stream.html.haml index 74e8a19..4a6b1e9 100644 --- a/app/views/streams/_stream.html.haml +++ b/app/views/streams/_stream.html.haml
@@ -2,5 +2,9 @@
2 %h2#stream-title= stream.title 2 %h2#stream-title= stream.title
3 - unless stream.body.blank? 3 - unless stream.body.blank?
4 %header#stream-intro.entry-content= markdown(stream.body) 4 %header#stream-intro.entry-content= markdown(stream.body)
5 - unless stream.updates.empty? 5 - if stream.updates.size > 10
6 = render stream.updates 6 = will_paginate @updates
7 - unless @updates.empty?
8 = render @updates
9 - if stream.updates.size > 10
10 = will_paginate @updates