Guillaume Occuly

Joined

2,020 Experience
20 Lessons Completed
0 Questions Solved

Activity

Can we use a PORO class to deliver ?
This is what I did

app/models/new_email.rb

class NewEmail
attr_reader :params

def initialize(params)
@params = params.permit(:to, :subject, :body)
end
end

app/controllers/emails_controller.rb

NewEmailNotification.with(email: NewEmail.new(params)).deliver_later(current_user)

I received an error: Unsupported argument type: NewEmail

Why settings is a text format and preferences is a json format ?

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

© 2024 GoRails, LLC. All rights reserved.