notebook/app/controllers/main_controller.rb
2016-10-14 23:26:32 +02:00

24 lines
560 B
Ruby

# Controller for top-level pages of the site that do not have
# an associated model
class MainController < ApplicationController
layout 'landing', only: [:index, :about_notebook]
def index
redirect_to :dashboard if user_signed_in?
end
def about_notebook
end
def comingsoon
end
def dashboard
return redirect_to new_user_session_path unless user_signed_in?
content_type = %w(characters locations items).sample
@content = current_user.send(content_type).sample
@question = @content.question unless @content.nil?
end
end