diff options
Diffstat (limited to 'app/controllers/streams_controller.rb')
-rw-r--r-- | app/controllers/streams_controller.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/controllers/streams_controller.rb b/app/controllers/streams_controller.rb index 664f533..ec4cee8 100644 --- a/app/controllers/streams_controller.rb +++ b/app/controllers/streams_controller.rb | |||
@@ -1,7 +1,26 @@ | |||
1 | class StreamsController < ApplicationController | 1 | class StreamsController < ApplicationController |
2 | include ApplicationHelper | ||
3 | |||
4 | def index | ||
5 | @streams = Stream.order(latest_post_at: :desc).paginate(page: params[:page], per_page: 10) | ||
6 | end | ||
2 | 7 | ||
3 | def show | 8 | def show |
4 | @stream = Stream.find_by_slug(params[:slug]) | 9 | @stream = Stream.find_by_slug(params[:slug]) |
10 | @updates = @stream.updates.paginate(page: params[:page], per_page: 10) | ||
11 | |||
12 | body = stripped_markdown(@stream.body) | ||
13 | |||
14 | set_meta_tags(og: { | ||
15 | title: @stream.title, | ||
16 | type: "article", | ||
17 | description: body[0, 299], | ||
18 | url: stream_url(@stream, host: "www.fourisland.com"), | ||
19 | article: { | ||
20 | published_time: @stream.created_at.iso8601, | ||
21 | modified_time: @stream.latest_post_at.iso8601 | ||
22 | } | ||
23 | }) | ||
5 | end | 24 | end |
6 | 25 | ||
7 | end | 26 | end |