2017-03-31 14:05:15 +00:00
|
|
|
class PostsController < BaseController
|
2013-02-07 00:39:42 +00:00
|
|
|
decorates_assigned :post
|
|
|
|
|
2012-10-19 12:03:29 +00:00
|
|
|
def show
|
2013-02-07 00:39:42 +00:00
|
|
|
@post = Post.find(params[:id])
|
2012-11-13 20:28:15 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def mail
|
2013-01-14 03:27:58 +00:00
|
|
|
post = Post.find(params[:id])
|
|
|
|
email = PostMailer.decorated_email(post).deliver
|
2017-05-05 15:28:28 +00:00
|
|
|
render html: email.body.to_s.html_safe
|
2012-11-13 20:28:15 +00:00
|
|
|
end
|
2013-01-16 16:30:53 +00:00
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def goodnight_moon
|
|
|
|
"Goodnight, moon!"
|
|
|
|
end
|
|
|
|
helper_method :goodnight_moon
|
2012-10-19 12:03:29 +00:00
|
|
|
end
|