Here, the view will be "test_email.html" as default.
def test_email(data)
notif_type = data['notif_type']
emails_list = ['[email protected]', '[email protected]']
subject = case notif_type
when 'test_case_1'
"test1"
when 'test_case_2'
"test2"
when 'test_case_3'
"test3"
mail(:to => emails_list, :subject => subject) do |format|
format.html { render :layout => 'layouts/newdesign' }
end
end
What I want is as follows: for test_case_3, render "test_case_3.html" for the rest, render "test_email" as default How could I achieve it?