相关疑难解决方法(0)

使用Rails 4.1 ActionMailer :: Preview预设电子邮件需要设置哪些路由?

class UserPreview < ActionMailer::Preview
  # Accessible from http://localhost:3000/rails/mailers/notifier/welcome_email
  def welcome_email
    UserMailer.welcome_email(User.first)
  end
end
Run Code Online (Sandbox Code Playgroud)

我使用Ruby on Rails 4.1进行了这个简单的邮件预览.

如果我注释掉了我routes.rb文件中的所有路由而只留下这个,那么邮件程序预览就会起作用:

MyTestApp::Application.routes.draw do

end
Run Code Online (Sandbox Code Playgroud)

所以显然我的一个权利是在默认的Rails之前用于邮件预览.

我需要输入路由rb文件?

routes ruby-on-rails preview mailer

9
推荐指数
1
解决办法
3408
查看次数

标签 统计

mailer ×1

preview ×1

routes ×1

ruby-on-rails ×1