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 rescue_from ActiveRecord::RecordNotFound, :with => :render_404
43 def render_404(exception = nil)
45 logger.info "Rendering 404: #{exception.message}"
47 respond_to do |format|
49 render :file => "#{Rails.root}/public/404.html", :status => 404, :layout => false
52 render :text => "404 found", :status => 404