Class: OnboardOnRails::Admin::LessonsController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- OnboardOnRails::ApplicationController
- BaseController
- OnboardOnRails::Admin::LessonsController
- Defined in:
- app/controllers/onboard_on_rails/admin/lessons_controller.rb
Instance Method Summary collapse
Methods inherited from BaseController
Instance Method Details
#index ⇒ Object
4 5 6 |
# File 'app/controllers/onboard_on_rails/admin/lessons_controller.rb', line 4 def index @lessons = Tour.where(ab_test_id: "self_tour").order(priority: :desc) end |
#recreate ⇒ Object
19 20 21 22 23 24 25 |
# File 'app/controllers/onboard_on_rails/admin/lessons_controller.rb', line 19 def recreate self_tours = Tour.where(ab_test_id: "self_tour") Completion.where(tour: self_tours).destroy_all self_tours.destroy_all SelfTourSeeder.seed! redirect_to admin_lessons_path, notice: t("onboard_on_rails.admin.lessons.recreate_success") end |
#replay ⇒ Object
8 9 10 11 12 |
# File 'app/controllers/onboard_on_rails/admin/lessons_controller.rb', line 8 def replay tour = Tour.find(params[:id]) Completion.where(tour: tour, user_id: current_user.id).destroy_all redirect_to resolve_lesson_url(tour), notice: t("onboard_on_rails.admin.lessons.replayed") end |
#seed ⇒ Object
14 15 16 17 |
# File 'app/controllers/onboard_on_rails/admin/lessons_controller.rb', line 14 def seed SelfTourSeeder.seed! redirect_to admin_lessons_path, notice: t("onboard_on_rails.admin.lessons.seed_success") end |