Class: Admin::ProgramsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Admin::ProgramsController
- Defined in:
- app/controllers/admin/programs_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/admin/programs_controller.rb', line 20 def create @program = Program.new(program_params) respond_to do |format| if @program.save flash[:notice] = 'Program was successfully created.' format.html { redirect_to(admin_program_path(@program)) } else format.html { render action: 'new' } end end end |
#edit ⇒ Object
17 18 |
# File 'app/controllers/admin/programs_controller.rb', line 17 def edit end |
#index ⇒ Object
6 7 8 |
# File 'app/controllers/admin/programs_controller.rb', line 6 def index @programs = Program.all end |
#new ⇒ Object
13 14 15 |
# File 'app/controllers/admin/programs_controller.rb', line 13 def new @program = Program.new end |
#show ⇒ Object
10 11 |
# File 'app/controllers/admin/programs_controller.rb', line 10 def show end |
#update ⇒ Object
33 34 35 36 37 38 39 40 41 42 |
# File 'app/controllers/admin/programs_controller.rb', line 33 def update respond_to do |format| if @program.update(program_params) flash[:notice] = 'Program was successfully updated.' format.html { redirect_to(admin_programs_path) } else format.html { render action: 'edit' } end end end |