Send multiple emails to different recipients.
# app/mailers/notify_mailer.rb
class NotifyMailer < ApplicationMailer
class Profile extends React.Component { | |
render(props) { | |
return <div>{props}</div> | |
} | |
} | |
// Dumb component | |
function Profile(props) { | |
return <div>{props}</div> |
def query(params) | |
# this magic method prepares sql and gets correct data from DB | |
# NO CHANGES HERE | |
puts "Params = #{params}" | |
[ | |
{name: "John", surname: "Doe", age: 33}, | |
{name: "John", surname: "Doe", age: 34}, | |
{name: "John", surname: "Doe", age: 35} | |
] | |
end |
def reverse_array(arr) | |
return arr if arr.empty? | |
arr = arr.dup | |
start_index = 0 | |
end_index = arr.length - 1 | |
while start_index < end_index | |
arr[start_index], arr[end_index] = arr[end_index], arr[start_index] |