Created
June 13, 2017 08:03
-
-
Save mikejakobsen/7c78484e09fc519c2ef893b08b639053 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 EmailsController < ApplicationController | |
def send_email | |
redirect_to_account if current_user.email.blank? | |
case params[:email].to_sym | |
when :rss_link | |
LinkMailer.rss_link(current_user).deliver_later | |
end | |
flash[:notice] = t(:inbox) | |
redirect_to :back | |
end | |
private | |
def redirect_to_account | |
redirect_to account_path, | |
error: t(:missingemail) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment