Class: HelpEngine::HelpPagesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/help_engine/help_pages_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /help_pages



26
27
28
29
30
31
32
33
34
# File 'app/controllers/help_engine/help_pages_controller.rb', line 26

def create
  @help_page = HelpPage.new(help_page_params)

  if @help_page.save
    redirect_to @help_page, notice: 'Help page was successfully created.'
  else
    render :new
  end
end

#destroyObject

DELETE /help_pages/1



46
47
48
49
# File 'app/controllers/help_engine/help_pages_controller.rb', line 46

def destroy
  @help_page.destroy
  redirect_to help_pages_url, notice: 'Help page was successfully destroyed.'
end

#editObject

GET /help_pages/1/edit



22
23
# File 'app/controllers/help_engine/help_pages_controller.rb', line 22

def edit
end

#indexObject

GET /help_pages



8
9
10
# File 'app/controllers/help_engine/help_pages_controller.rb', line 8

def index
  @help_pages = HelpPage.all
end

#newObject

GET /help_pages/new



17
18
19
# File 'app/controllers/help_engine/help_pages_controller.rb', line 17

def new
  @help_page = HelpPage.new
end

#showObject

GET /help_pages/1



13
14
# File 'app/controllers/help_engine/help_pages_controller.rb', line 13

def show
end

#updateObject

PATCH/PUT /help_pages/1



37
38
39
40
41
42
43
# File 'app/controllers/help_engine/help_pages_controller.rb', line 37

def update
  if @help_page.update(help_page_params)
    redirect_to @help_page, notice: 'Help page was successfully updated.'
  else
    render :edit
  end
end