Class: Effective::CpdCyclesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Effective::CpdCyclesController
- Defined in:
- app/controllers/effective/cpd_cycles_controller.rb
Instance Method Summary collapse
-
#show ⇒ Object
If they visit /cpd_cycles/1, redirect to their statement for that cycle.
Instance Method Details
#show ⇒ Object
If they visit /cpd_cycles/1, redirect to their statement for that cycle
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/effective/cpd_cycles_controller.rb', line 6 def show cycle = Effective::CpdCycle.find(params[:id]) EffectiveResources.(self, :show, cycle) statement = EffectiveCpd.CpdStatement.where(cpd_cycle: cycle, user: current_user).first if statement.present? redirect_to effective_cpd.cpd_cycle_cpd_statement_build_path(cycle, statement, statement.next_step) else redirect_to effective_cpd.cpd_cycle_cpd_statement_build_path(cycle, :new, :start) end end |