Last active
August 29, 2015 14:04
-
-
Save thanhcuong1990/dafbd311516f1b84a37d to your computer and use it in GitHub Desktop.
Fat model & Skinny controller examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /app/controllers/posts_controller.rb | |
class PostsController < ApplicationController | |
def repost | |
post = Post.find(params[:id]) | |
flash[:notice] = post.repost_by(current_user) | |
redirect_to post | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment