Class: MyTimeline::PostsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- MyTimeline::PostsController
- Defined in:
- app/controllers/my_timeline/posts_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/my_timeline/posts_controller.rb', line 9 def create @post = Post.new(rails4? ? post_params : params[:post]) @post.event.happened_on = @post.happened_on @post.event.user_id = @user.id @post.event.icon_name = "notes.png" if @post.save @post.event.linkable = @post @post.event.save redirect_to root_path, notice: "Post saved." else render :new end end |