Class: LesliBabel::BucketsController
- Inherits:
-
ApplicationController
- Object
- Lesli::ApplicationLesliController
- ApplicationController
- LesliBabel::BucketsController
- Defined in:
- app/controllers/lesli_babel/buckets_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /buckets.
-
#destroy ⇒ Object
DELETE /buckets/1.
-
#edit ⇒ Object
GET /buckets/1/edit.
-
#index ⇒ Object
GET /buckets.
-
#new ⇒ Object
GET /buckets/new.
-
#show ⇒ Object
GET /buckets/1.
-
#update ⇒ Object
PATCH/PUT /buckets/1.
Instance Method Details
#create ⇒ Object
POST /buckets
55 56 57 58 59 60 61 62 63 64 65 |
# File 'app/controllers/lesli_babel/buckets_controller.rb', line 55 def create bucket = Bucket.new(bucket_params) bucket.module = Module.find(params[:module_id]) bucket.reference_module = bucket.module.name if bucket.save respond_with_successful bucket else respond_with_error bucket.errors. end end |
#destroy ⇒ Object
DELETE /buckets/1
77 78 79 80 |
# File 'app/controllers/lesli_babel/buckets_controller.rb', line 77 def destroy @bucket.destroy redirect_to buckets_url, notice: 'Bucket was successfully destroyed.' end |
#edit ⇒ Object
GET /buckets/1/edit
51 52 |
# File 'app/controllers/lesli_babel/buckets_controller.rb', line 51 def edit end |
#index ⇒ Object
GET /buckets
38 39 40 |
# File 'app/controllers/lesli_babel/buckets_controller.rb', line 38 def index Bucket.all end |
#new ⇒ Object
GET /buckets/new
47 48 |
# File 'app/controllers/lesli_babel/buckets_controller.rb', line 47 def new end |
#show ⇒ Object
GET /buckets/1
43 44 |
# File 'app/controllers/lesli_babel/buckets_controller.rb', line 43 def show end |
#update ⇒ Object
PATCH/PUT /buckets/1
68 69 70 71 72 73 74 |
# File 'app/controllers/lesli_babel/buckets_controller.rb', line 68 def update if @bucket.update(bucket_params) redirect_to @bucket, notice: 'Bucket was successfully updated.' else render :edit end end |