Я пытаюсь отправить объект (пользователя) к NotificationsMailer так:Отправка объекта с помощью pry?
pry(main)>NotificationsMailer.welcome_facebook_user({:password=>'123',:email=>'[email protected]',:basic_profile=>{:name=>'Samir'}}).deliver
Но я получил эту ошибку:
ActionView::Template::Error: undefined method `basic_profile' for #<Hash:0x0000000786d588>
from /app/app/views/notifications_mailer/welcome_facebook_user.html.haml:2:in `block in _app_views_notifications_mailer_welcome_facebook_user_html_haml__4104442834642741128_62933320'
NotificationsMailer.welcome_facebook_user:
def welcome_facebook_user(user)
@user = user
puts "SENT welcome_facebook_user TO:"
puts user[:email]
mail(:to=>user[:email], :subject => "Welcome!")
end
Мой шаблон :
=content_for :title do
Welcome, #{@user.basic_profile.name unless @user.basic_profile.nil?}
В реальном мире:
User.rb
class User < Refinery::Core::BaseModel
has_one :basic_profile
Но я хочу, чтобы проверить его с помощью Поддеть, как отправить такой объект пользователя? почему моя попытка не удалась?