15 lines
322 B
Ruby
15 lines
322 B
Ruby
|
|
class HomeController < ApplicationController
|
||
|
|
allow_unauthenticated_access
|
||
|
|
|
||
|
|
def index
|
||
|
|
user = User.find_by(username: request.subdomain)
|
||
|
|
if user&.public?
|
||
|
|
@mode = user.current_mood
|
||
|
|
@history = user.history
|
||
|
|
render template: "moods/index"
|
||
|
|
else
|
||
|
|
redirect_to dashboard_path
|
||
|
|
end
|
||
|
|
end
|
||
|
|
end
|