Class: Lightning::FeaturesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Lightning::FeaturesController
- Defined in:
- app/controllers/lightning/features_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'app/controllers/lightning/features_controller.rb', line 22 def create @feature = Feature.new(feature_params) if @feature.save redirect_to @feature, notice: 'Feature was successfully created.' else render :new end end |
#destroy ⇒ Object
40 41 42 43 |
# File 'app/controllers/lightning/features_controller.rb', line 40 def destroy @feature.destroy redirect_to features_url, notice: 'Feature was successfully destroyed.' end |
#edit ⇒ Object
19 20 |
# File 'app/controllers/lightning/features_controller.rb', line 19 def edit end |
#index ⇒ Object
7 8 9 |
# File 'app/controllers/lightning/features_controller.rb', line 7 def index @features = Feature.all end |
#new ⇒ Object
15 16 17 |
# File 'app/controllers/lightning/features_controller.rb', line 15 def new @feature = Feature.new end |
#show ⇒ Object
11 12 13 |
# File 'app/controllers/lightning/features_controller.rb', line 11 def show @flaggable_entities = Lightning.flaggable_entities end |
#update ⇒ Object
32 33 34 35 36 37 38 |
# File 'app/controllers/lightning/features_controller.rb', line 32 def update if @feature.update(feature_params) redirect_to @feature, notice: 'Feature was successfully updated.' else render :edit end end |