From cbe536a56b6f76d57b9f9224d41a3f57584e783a Mon Sep 17 00:00:00 2001 From: Thomas Blazek Date: Thu, 22 Aug 2013 13:49:11 +0200 Subject: [PATCH] bugfix multiple lines --- app/controllers/fotos_controller.rb | 2 +- app/models/foto.rb | 2 +- app/views/fotos/_form_bulk.html.erb | 155 ++++++++++++++-------------- 3 files changed, 80 insertions(+), 79 deletions(-) diff --git a/app/controllers/fotos_controller.rb b/app/controllers/fotos_controller.rb index 168e32e..af920da 100644 --- a/app/controllers/fotos_controller.rb +++ b/app/controllers/fotos_controller.rb @@ -46,7 +46,7 @@ class FotosController < ApplicationController @foto.gallery_id = (params[:gallery_id]) @gallery = @foto.gallery respond_to do |format| - @foto.title = @foto.datei + @foto.title = @foto.datei.filename if @foto.save format.html { render :json => [@foto.to_jq_upload].to_json, diff --git a/app/models/foto.rb b/app/models/foto.rb index 022d0fe..bcd6a2b 100644 --- a/app/models/foto.rb +++ b/app/models/foto.rb @@ -8,7 +8,7 @@ class Foto < ActiveRecord::Base "id" => read_attribute(:id), "title" => read_attribute(:title), "description" => read_attribute(:desc), - "name" => read_attribute(:datei), + "name" => read_attribute(:title), "size" => datei.size, "url" => datei.url, "thumbnail_url" => datei.thumb.url, diff --git a/app/views/fotos/_form_bulk.html.erb b/app/views/fotos/_form_bulk.html.erb index 6c2d0a1..283bfa3 100644 --- a/app/views/fotos/_form_bulk.html.erb +++ b/app/views/fotos/_form_bulk.html.erb @@ -1,43 +1,43 @@

Upload file

<%= semantic_form_for [@gallery, @foto], :remote=>true, :html => { :multipart => true, :id => "fileupload" } do |f| %> - -
-
- - - - Add files... - <%= f.file_field :datei, :multiple=>true%> - <%= f.input :gallery %> - - - - - -
-
- -
-
-
+ +
+
+ + + + Add files... + <%= f.file_field :datei, :multiple=>true%> + <%= f.input :gallery %> + + + + + +
+
+ +
+
- -
-
- - -
+
+ +
+
+ + +
<% end %>
@@ -86,53 +86,54 @@