Class: CompletionKit::OnboardingController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- CompletionKit::OnboardingController
- Defined in:
- app/controllers/completion_kit/onboarding_controller.rb
Constant Summary collapse
- DISMISS_COOKIE =
:ck_onboarding_dismissed
Instance Method Summary collapse
Instance Method Details
#dismiss ⇒ Object
13 14 15 16 |
# File 'app/controllers/completion_kit/onboarding_controller.rb', line 13 def dismiss [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_data ⇒ Object
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 |
#show ⇒ Object
5 6 7 8 9 10 11 |
# File 'app/controllers/completion_kit/onboarding_controller.rb', line 5 def show .delete(DISMISS_COOKIE) if params[:reset] @checklist = Onboarding::Checklist.new return if params[:reset] redirect_to prompts_path if @checklist.complete? || [DISMISS_COOKIE] end |