save new album to current collection

This commit is contained in:
Espen Antonsen 2009-06-30 22:41:27 +02:00
parent 0fb47748db
commit 07493aaaad
2 changed files with 5 additions and 0 deletions

View file

@ -45,6 +45,9 @@ class AlbumsController < ApplicationController
@album = Album.new(params[:album])
@album.path = @album.title
if @album.save
if params[:collection_id]
@album.collections << Collection.find( params[:collection_id] )
end
flash[:notice] = "Album created!"
redirect_to @album
else