my_message
我有一条消息config/locales/post.en.yml
如下:
en:
post:
show:
my_message: "Post was successfully saved. And Boom!"
我如何在控制器的方法中调用这个 :my_message 来表示闪存?
class PostsController < ApplicationController
def show
flash[:error] = my_message
end
end