Guest User

Untitled

a guest
Oct 19th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. class MicropostsController < ApplicationController
  2. before_filter :authenticate
  3.  
  4. def create
  5. @micropost = current_user.microposts.build(params[:micropost])
  6. if @micropost.save
  7. redirect_to root_path, :flash => { :success => "Micropost created!" }
  8. else
  9. @feed_items = []
  10. render 'pages/home'
  11. end
  12. end
  13.  
  14. def destroy
  15.  
  16. end
  17. end
Add Comment
Please, Sign In to add comment