Class: Paginas::PagesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/paginas/pages_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



22
23
24
25
26
27
28
29
# File 'app/controllers/paginas/pages_controller.rb', line 22

def create
  @page = Page.new(page_params)
  if @page.save
    redirect_to @page, notice: 'Page was successfully created.'
  else
    render :new
  end
end

#destroyObject



37
38
39
40
# File 'app/controllers/paginas/pages_controller.rb', line 37

def destroy
  @page.destroy
  redirect_to pages_url, notice: 'Page was successfully destroyed.'
end

#displayObject



15
16
# File 'app/controllers/paginas/pages_controller.rb', line 15

def display
end

#editObject



20
21
# File 'app/controllers/paginas/pages_controller.rb', line 20

def edit
end


9
10
11
12
# File 'app/controllers/paginas/pages_controller.rb', line 9

def featured
  @pages = Page.where(featured: true)
  render :featured
end

#indexObject



6
7
8
# File 'app/controllers/paginas/pages_controller.rb', line 6

def index
  @pages = Page.all
end

#newObject



17
18
19
# File 'app/controllers/paginas/pages_controller.rb', line 17

def new
  @page = Page.new
end

#showObject



13
14
# File 'app/controllers/paginas/pages_controller.rb', line 13

def show
end

#updateObject



30
31
32
33
34
35
36
# File 'app/controllers/paginas/pages_controller.rb', line 30

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