undefined method `flash' for ActionDispatch::Request

前端 未结 3 1947
情歌与酒
情歌与酒 2020-12-08 20:14

I\'m trying to write an Ember application in Rails 4, and have decided to go with rails-api for the api controllers, while keeping the application controller in

3条回答
  •  南方客
    南方客 (楼主)
    2020-12-08 21:05

    Not sure but maybe you need to include the ActionDispatch::Flash middleware to support the flash. Using:

    config.middleware.use ActionDispatch::Flash
    

    The docs says:

    ActionDispatch::Flash: Supports the flash mechanism in ActionController.

    I hope it helps

提交回复
热议问题