1 class ApplicationController < ActionController::Base
6 if Admin.count.to_i == 0 or License.count.to_i == 0
7 if params[:controller] == 'system' and params[:action] == 'start'
9 redirect_to :controller => '/system', :action => 'start'
14 @author = @user.author
15 @artist = if @author and @author.artist?
18 Artist.new author_id: @author.id, email: @user.email, name: @author.name
24 def authenticate_artist
28 respond_to do |format|
29 format.html { redirect_to main_app.new_artist_path, :status => :found }
30 format.js { render "artists/new" }
32 raise ActiveRecord::Forbidden
40 if file.respond_to?(:read)
43 Base64.decode64(file.to_s.gsub(' ', '+')) #rubyのバグ?+でデコードされるべきキャラがスペースになる
48 rescue_from ActiveRecord::RecordNotFound, :with => :render_404
51 def render_404(exception = nil)
53 logger.info "Rendering 404: #{exception.message}"
55 respond_to do |format|
57 render :file => "#{Rails.root}/public/404.html", :status => 404, :layout => false
60 render :text => "404 found", :status => 404