I couldn’t help notice though in the video that the thing that repeats still in ActionMailer is the constant assignment of variables to instance variables in the mailer methods.
This happens constantly with us, where we pass objects to a mailer method and that mailer method just needs to assign variables to instance variables with the same name.
Should there be some automated way to do this? I wonder if ruby could interrogate the param names of a mailer method, and define instance vars for the mailer view?
DHH
on 15 Jun 10
Nathan, I looked at that too, but found too many times where I didn’t want exactly the same thing copied in. Or I wanted to change the naming. Or I was passing something else in that needed processing first.
Interrogating all the parameters and automatically assigning them would be too clever.
This discussion is closed.
About Basecamp
Basecamp is everyone’s favorite project management app. Meet the team, if you'd like.
Robert
on 14 Jun 10How could you publish such a long video on youtube??? Isn’t it 10 minutes maximum? Sorry for the change of subject.
Curtis
on 14 Jun 10Liked the video – subtitles were way off though
Michael
on 14 Jun 10Robert, you can publish long videos if you have the right account type for your channel. It’s in your account settings.
Nathan Kontny
on 14 Jun 10I couldn’t help notice though in the video that the thing that repeats still in ActionMailer is the constant assignment of variables to instance variables in the mailer methods.
This happens constantly with us, where we pass objects to a mailer method and that mailer method just needs to assign variables to instance variables with the same name.
Should there be some automated way to do this? I wonder if ruby could interrogate the param names of a mailer method, and define instance vars for the mailer view?
DHH
on 15 Jun 10Nathan, I looked at that too, but found too many times where I didn’t want exactly the same thing copied in. Or I wanted to change the naming. Or I was passing something else in that needed processing first.
Interrogating all the parameters and automatically assigning them would be too clever.
This discussion is closed.