1 class ApplicationController < ActionController::Base
7 :location => {:controller => params[:controller], :action => params[:action]}
9 @server_result[:location][:id] = params[:id] if params[:id]
10 if Admin.count.to_i == 0 or License.count.to_i == 0
11 if params[:controller] == 'system' and params[:action] == 'start'
13 redirect_to :controller => '/system', :action => 'start'
18 @author = @user.author
19 @artist = if @author and @author.artist?
25 @admin = if admin_signed_in?
33 def authenticate_artist
37 respond_to do |format|
38 format.html { redirect_to main_app.new_artist_path, :status => :found }
39 format.js { render "artists/new" }
41 raise ActiveRecord::Forbidden
49 if file.respond_to?(:read)
52 Base64.decode64(file.to_s.gsub(' ', '+')) #rubyのバグ?+でデコードされるべきキャラがスペースになる
57 rescue_from ActiveRecord::RecordNotFound, :with => :render_404
60 def render_404(exception = nil)
62 logger.info "Rendering 404: #{exception.message}"
64 respond_to do |format|
66 render :file => "#{Rails.root}/public/404.html", :status => 404, :layout => false
69 render :text => "404 found", :status => 404