Last active
December 10, 2015 08:18
-
-
Save AlexanderZaytsev/4406333 to your computer and use it in GitHub Desktop.
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 MessagesController < ActionController::Base | |
def create | |
@message = Message.create! message_params | |
MessageTranslator.new(@message).translate! # Sends a request to Google Translate API | |
MessagePusher.new(@message).push! # Pushes to Pusher.com | |
end | |
def update | |
@message.update_attributes message_params | |
MessageTranslator.new(@message).translate! | |
MessagePusher.new(@message).push! | |
end | |
end | |
class Admin::MessagesController < ActionController::Base | |
def update | |
@message.update_attributes message_params | |
MessageTranslator.new(@message).translate! | |
MessagePusher.new(@message).push! | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment