diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/streams_controller.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/controllers/streams_controller.rb b/app/controllers/streams_controller.rb index aa81ab1..ec4cee8 100644 --- a/app/controllers/streams_controller.rb +++ b/app/controllers/streams_controller.rb | |||
@@ -1,4 +1,5 @@ | |||
1 | class StreamsController < ApplicationController | 1 | class StreamsController < ApplicationController |
2 | include ApplicationHelper | ||
2 | 3 | ||
3 | def index | 4 | def index |
4 | @streams = Stream.order(latest_post_at: :desc).paginate(page: params[:page], per_page: 10) | 5 | @streams = Stream.order(latest_post_at: :desc).paginate(page: params[:page], per_page: 10) |
@@ -7,6 +8,19 @@ class StreamsController < ApplicationController | |||
7 | def show | 8 | def show |
8 | @stream = Stream.find_by_slug(params[:slug]) | 9 | @stream = Stream.find_by_slug(params[:slug]) |
9 | @updates = @stream.updates.paginate(page: params[:page], per_page: 10) | 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 | }) | ||
10 | end | 24 | end |
11 | 25 | ||
12 | end | 26 | end |