OSDN Git Service

add stub SongSearchForm
[praisedb/praisedb.git] / app / controllers / songs_controller.rb
index 3d0b8fb..308341b 100644 (file)
@@ -23,7 +23,17 @@ class SongsController < BaseController
   end
 
   def edit
-    @song = Song.find_by_id(params[:id])
+    @song = Song.active.find_by_id(params[:id])
     redirect_to songs_path if @song.blank?
   end
+
+  def list
+    @songs = Song.active.all
+  end
+
+  def search
+    song_search_form = SongSearchForm.new(params[:search])
+    conditions = song_search_form.conditions
+    @songs = Song.find(:all, conditions)
+  end
 end