Skip to content

Commit

Permalink
makes .rss route available on talks#show...
Browse files Browse the repository at this point in the history
* for people who want to subscribe to only one talk
  • Loading branch information
branch14 committed May 11, 2015
1 parent b348711 commit 5fc584c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/controllers/talks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ def show
end
format.png { send_file @talk.flyer.path(true) }
format.ics
format.rss do
@podcast = OpenStruct.new(talks: [@talk])
end
end
end

Expand Down
18 changes: 18 additions & 0 deletions app/views/talks/show.rss.builder
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# TODO
@podcast.category = 'Society & Culture'

# translations
@podcast.title = t('.podcast.title', title: @talk.title)
@podcast.image_title = t('.podcast.title', title: @talk.title)

# misc
@podcast.description = @talk.description_as_plaintext
@podcast.author = @talk.user.name # delegate via venue
@podcast.subtitle = @talk.teaser

# urls
@podcast.url = talk_url(@talk)
@podcast.image_link = talk_url(@talk)
@podcast.image_url = @talk.image.thumb('1400x1400#').url

xml << render(partial: 'shared/podcast', locals: { xml: xml })

0 comments on commit 5fc584c

Please sign in to comment.