Class: Zencms::Backend::PostsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Zencms::Backend::PostsController
- Defined in:
- app/controllers/zencms/backend/posts_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
-
#update ⇒ Object
before_filter :authenticate_user! load_and_authorize_resource.
Instance Method Details
#create ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'app/controllers/zencms/backend/posts_controller.rb', line 21 def create @post = build_resource @post.user = current_user create! do |success, failure| success.html{ redirect_to post_path(@post) } failure.html{ render action: "new" } end end |
#update ⇒ Object
before_filter :authenticate_user! load_and_authorize_resource
14 15 16 17 18 19 |
# File 'app/controllers/zencms/backend/posts_controller.rb', line 14 def update update! do |success, failure| success.html{ redirect_to post_path(resource) } failure.html{ render action: "edit" } end end |