forked from tadejm/hipsterija
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
30 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
class EpisodesController < ApplicationController | ||
def index | ||
@episodes = Episode.all | ||
|
||
respond_to do |format| | ||
format.html | ||
format.atom { @episodes } | ||
end | ||
end | ||
|
||
def show | ||
@episode = Episode.find params[:id] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
atom_feed language: 'en-US' do |feed| | ||
feed.title "Hipsterija" | ||
feed.updated Time.now | ||
|
||
@episodes.each do |episode| | ||
feed.entry(episode) do |entry| | ||
entry.url episode.link | ||
entry.title episode.title | ||
entry.content(link_to(episode.link), type: 'html') | ||
# the strftime is needed to work with Google Reader. | ||
entry.updated(episode.created_at.strftime("%Y-%m-%dT%H:%M:%SZ")) | ||
entry.author 'Radio študent' | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
%h2= @episode.title | ||
= audio_tag(audio_path(@episode.link), autoplay: true, controls: true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters