Class: CompletionKit::OnboardingController

Inherits:
ApplicationController show all
Defined in:
app/controllers/completion_kit/onboarding_controller.rb

Constant Summary collapse

:ck_onboarding_dismissed

Instance Method Summary collapse

Instance Method Details

#dismissObject



13
14
15
16
# File 'app/controllers/completion_kit/onboarding_controller.rb', line 13

def dismiss
  cookies[DISMISS_COOKIE] = { value: "1", expires: 1.year.from_now, httponly: true }
  redirect_to prompts_path, notice: "Setup skipped. Pick it back up from Settings → Getting started any time."
end

#sample_dataObject



18
19
20
21
# File 'app/controllers/completion_kit/onboarding_controller.rb', line 18

def sample_data
  Onboarding::SampleData.install!
  redirect_to onboarding_path, notice: "Loaded a sample dataset and prompt — edit or delete them whenever."
end

#showObject



5
6
7
8
9
10
11
# File 'app/controllers/completion_kit/onboarding_controller.rb', line 5

def show
  cookies.delete(DISMISS_COOKIE) if params[:reset]
  @checklist = Onboarding::Checklist.new
  return if params[:reset]

  redirect_to prompts_path if @checklist.complete? || cookies[DISMISS_COOKIE]
end