OSDN Git Service

t#30102#30122:update i18n pictures
[pettanr/pettanr.git] / app / controllers / application_controller.rb
index f108ef9..970bb9d 100644 (file)
@@ -3,6 +3,10 @@ class ApplicationController < ActionController::Base
   before_filter :bf
   
   def bf
+    @server_result = {
+      :location => {:controller => params[:controller], :action => params[:action]}
+    }
+    @server_result[:location][:id] = params[:id] if params[:id]
     if Admin.count.to_i == 0 or License.count.to_i == 0
       if params[:controller] == 'system' and params[:action] == 'start'
       else
@@ -15,7 +19,7 @@ class ApplicationController < ActionController::Base
         @artist = if @author and @author.artist?
           @author.artist
         else
-          Artist.new author_id: @author.id, email: @user.email, name: @author.name, default_license_id: 1
+          nil
         end
       end
     end
@@ -26,7 +30,7 @@ class ApplicationController < ActionController::Base
       true
     else
       respond_to do |format|
-        format.html { redirect_to new_artist_path, :status => :found }
+        format.html { redirect_to main_app.new_artist_path, :status => :found }
         format.js { render "artists/new" }
         format.json { 
           raise ActiveRecord::Forbidden
@@ -36,6 +40,14 @@ class ApplicationController < ActionController::Base
     end
   end
   
+  def set_image(file)
+    if file.respond_to?(:read)
+      file.read
+    else
+      Base64.decode64(file.to_s.gsub(' ', '+')) #rubyのバグ?+でデコードされるべきキャラがスペースになる
+    end
+  end
+  
 =begin
   rescue_from ActiveRecord::RecordNotFound, :with => :render_404