Last active
December 14, 2015 15:39
-
-
Save hueyl77/5109750 to your computer and use it in GitHub Desktop.
Mailgun AuthenticatedController sample
This file contains 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
class Courses::PostsController < AuthenticatedController | |
expose(:course) | |
expose(:posts) { course.posts } | |
expose(:post) | |
def create | |
post.user = current_user | |
post.save | |
CourseNotifier.new(course).notify_course_participants_on_new_discussion(post) | |
redirect_to course_home_path(course) | |
end | |
... | |
end | |
class Courses::Posts::CommentsController < AuthenticatedController | |
expose(:course) | |
expose(:posts) { course.posts } | |
expose(:post) | |
expose(:comments) { post.comments } | |
expose(:comment) | |
def create | |
comment.user = current_user | |
comment.save | |
CourseNotifier.new(course).notify_course_participants_on_new_discussion(comment) | |
redirect_to course_home_path(course) | |
end | |
... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment