Class: NextSgad::ActivitiesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- NextSgad::ActivitiesController
- Defined in:
- app/controllers/next_sgad/activities_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /activities.
-
#destroy ⇒ Object
DELETE /activities/1.
-
#edit ⇒ Object
GET /activities/1/edit.
-
#index ⇒ Object
GET /activities.
-
#new ⇒ Object
GET /activities/new.
-
#show ⇒ Object
GET /activities/1.
-
#update ⇒ Object
PATCH/PUT /activities/1.
Instance Method Details
#create ⇒ Object
POST /activities
27 28 29 30 31 32 33 34 35 |
# File 'app/controllers/next_sgad/activities_controller.rb', line 27 def create @activity = Activity.new(activity_params) if @activity.save redirect_to @activity, notice: 'Activity was successfully created.' else render :new end end |
#destroy ⇒ Object
DELETE /activities/1
47 48 49 50 |
# File 'app/controllers/next_sgad/activities_controller.rb', line 47 def destroy @activity.destroy redirect_to activities_url, notice: 'Activity was successfully destroyed.' end |
#edit ⇒ Object
GET /activities/1/edit
23 24 |
# File 'app/controllers/next_sgad/activities_controller.rb', line 23 def edit end |
#index ⇒ Object
GET /activities
8 9 10 |
# File 'app/controllers/next_sgad/activities_controller.rb', line 8 def index @activities = Activity.all end |
#new ⇒ Object
GET /activities/new
18 19 20 |
# File 'app/controllers/next_sgad/activities_controller.rb', line 18 def new @activity = Activity.new end |
#show ⇒ Object
GET /activities/1
13 14 |
# File 'app/controllers/next_sgad/activities_controller.rb', line 13 def show end |
#update ⇒ Object
PATCH/PUT /activities/1
38 39 40 41 42 43 44 |
# File 'app/controllers/next_sgad/activities_controller.rb', line 38 def update if @activity.update(activity_params) redirect_to @activity, notice: 'Activity was successfully updated.' else render :edit end end |