Factored sidebar draggables into application.js
[lyrix.git] / app / helpers / application_helper.rb
blob93e5f74ea09ff3db44d29fffe430186979eaa8aa
1 # Methods added to this helper will be available to all templates in the application.
2 module ApplicationHelper
3   def class_for_song(song)
4     if @song.nil?
5       'song'
6     elsif @song.id == song.id
7       'current song'
8     else
9       'song'
10     end
11   end
12   
13   def class_for_show(show)
14     if @show.nil?
15       'show'
16     elsif @show.id == show.id
17       'current show'
18     else
19       'show'
20     end
21   end
22   
23   def all_songs
24     Song.find(:all, :order => 'title')
25   end
26   
27   def all_shows
28     Show.find(:all, :order => 'created_at DESC')
29   end
30 end