Class: Lightning::FeaturesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/lightning/features_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



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

#destroyObject



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

#editObject



19
20
# File 'app/controllers/lightning/features_controller.rb', line 19

def edit
end

#indexObject



7
8
9
# File 'app/controllers/lightning/features_controller.rb', line 7

def index
  @features = Feature.all
end

#newObject



15
16
17
# File 'app/controllers/lightning/features_controller.rb', line 15

def new
  @feature = Feature.new
end

#showObject



11
12
13
# File 'app/controllers/lightning/features_controller.rb', line 11

def show
  @flaggable_entities = Lightning.flaggable_entities
end

#updateObject



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