Class: Blogit::PostsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Blogit::PostsController
- Defined in:
- app/controllers/blogit/posts_controller.rb
Instance Method Summary (collapse)
- - (Object) create
- - (Object) destroy
- - (Object) edit
- - (Object) index
- - (Object) new
- - (Object) show
- - (Object) update
Methods inherited from ApplicationController
blogit_authenticate, blogit_conf, #blogit_conf, #current_blogger, #this_blogger?
Instance Method Details
- (Object) create
33 34 35 36 37 38 39 |
# File 'app/controllers/blogit/posts_controller.rb', line 33 def create if post.save redirect_to post, notice: 'Blog post was successfully created.' else render action: "new" end end |
- (Object) destroy
49 50 51 52 |
# File 'app/controllers/blogit/posts_controller.rb', line 49 def destroy post.destroy redirect_to posts_url, notice: "Blog post was successfully destroyed." end |
- (Object) edit
30 31 |
# File 'app/controllers/blogit/posts_controller.rb', line 30 def edit end |
- (Object) index
21 22 |
# File 'app/controllers/blogit/posts_controller.rb', line 21 def index end |
- (Object) new
27 28 |
# File 'app/controllers/blogit/posts_controller.rb', line 27 def new end |
- (Object) show
24 25 |
# File 'app/controllers/blogit/posts_controller.rb', line 24 def show end |
- (Object) update
41 42 43 44 45 46 47 |
# File 'app/controllers/blogit/posts_controller.rb', line 41 def update if post.update_attributes(params[:post]) redirect_to post, notice: 'Blog post was successfully updated.' else render action: "edit" end end |