Class: Blogg::PostsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/blogg/posts_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_ability

Instance Method Details

#createObject


20
21
22
23
24
# File 'app/controllers/blogg/posts_controller.rb', line 20

def create
  @post = Post.new(params[:post])
  @post.author = current_user
  create!(:notice => "Blog post was successfully created.")
end

#destroyObject


12
13
14
# File 'app/controllers/blogg/posts_controller.rb', line 12

def destroy
  destroy!(:notice => "Blog post was successfully deleted.")
end

#updateObject


16
17
18
# File 'app/controllers/blogg/posts_controller.rb', line 16

def update
  update!(:notice => "Blog post was successfully updated.")
end