Class: Krikri::InstitutionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Krikri::InstitutionsController
- Defined in:
- app/controllers/krikri/institutions_controller.rb
Overview
Marshalls Institutions for views
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'app/controllers/krikri/institutions_controller.rb', line 18 def create @institution = Institution.new(institution_params) if @institution.save redirect_to @institution else render 'new' end end |
#destroy ⇒ Object
40 41 42 43 44 |
# File 'app/controllers/krikri/institutions_controller.rb', line 40 def destroy @institution = Institution.find(params[:id]) @institution.destroy redirect_to institutions_path end |
#edit ⇒ Object
27 28 29 |
# File 'app/controllers/krikri/institutions_controller.rb', line 27 def edit @institution = Institution.find(params[:id]) end |
#index ⇒ Object
5 6 7 |
# File 'app/controllers/krikri/institutions_controller.rb', line 5 def index @institutions = Institution.all end |
#new ⇒ Object
14 15 16 |
# File 'app/controllers/krikri/institutions_controller.rb', line 14 def new @institution = Institution.new end |
#show ⇒ Object
9 10 11 12 |
# File 'app/controllers/krikri/institutions_controller.rb', line 9 def show @institution = Institution.find(params[:id]) @harvest_sources = @institution.harvest_sources end |
#update ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'app/controllers/krikri/institutions_controller.rb', line 31 def update @institution = Institution.find(params[:id]) if @institution.update(institution_params) redirect_to @institution else render 'edit' end end |