diff --git a/app/controllers/albums_controller.rb b/app/controllers/albums_controller.rb index 862d603..3912457 100644 --- a/app/controllers/albums_controller.rb +++ b/app/controllers/albums_controller.rb @@ -47,7 +47,8 @@ class AlbumsController < ApplicationController @album = Album.new(params[:album]) @album.path = @album.title if @album.save - if params[:collection_id] + unless params[:collection_id].empty? + puts "has params" @album.collections << Collection.find( params[:collection_id] ) end flash[:notice] = "Album created!" diff --git a/app/models/album.rb b/app/models/album.rb index fe83a13..3aeceef 100644 --- a/app/models/album.rb +++ b/app/models/album.rb @@ -92,7 +92,7 @@ class Album < ActiveRecord::Base def create_folders Dir.mkdir( APP_CONFIG[:photos_path] + self.path ) unless File.exists?( APP_CONFIG[:photos_path] + self.path ) - Dir.mkdir( APP_CONFIG[:thumbs_path] + self.path ) unless File.exists?( APP_CONFIG[:thumbs_path] + self.path ) + Dir.mkdir( APP_CONFIG[:thumbs_path] + self.path.encode("ASCII-8BIT") ) unless File.exists?( APP_CONFIG[:thumbs_path] + self.path ) end def destroy_folders