Class: Admin::BlogsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/admin/blogs_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



15
16
17
18
19
20
21
22
23
# File 'app/controllers/admin/blogs_controller.rb', line 15

def create
  @blog = Blog.new(params[:blog])
  if @blog.save
    flash[:notice] = 'Successfully set up the blog.'
    redirect_to admin_blog_path(@blog)
  else
    render :action => 'new'
  end
end

#editObject



25
26
# File 'app/controllers/admin/blogs_controller.rb', line 25

def edit
end

#indexObject



6
7
# File 'app/controllers/admin/blogs_controller.rb', line 6

def index
end

#newObject



12
13
# File 'app/controllers/admin/blogs_controller.rb', line 12

def new
end

#showObject



9
10
# File 'app/controllers/admin/blogs_controller.rb', line 9

def show
end

#updateObject



28
29
30
31
32
33
34
35
# File 'app/controllers/admin/blogs_controller.rb', line 28

def update
  if @blog.update_attributes(params[:blog])
    flash[:notice] = 'Successfully modified the blog.'
    redirect_to admin_blog_path(@blog)
  else
    render :action => 'edit'
  end
end