Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Posts controller...
- ...
- #I want to allow only the post owner to be able to view "show" their own post(s)
- ...
- # I would do this though
- def show
- @post = current_user.posts.find(params[:id])
- respond_to do |format|
- format.html # show.html.erb
- format.xml { render :xml => @post }
- end
- end
- ... other basic crud methods
- ...
Add Comment
Please, Sign In to add comment