Rails 3 Flash Uploader
I am trying to get Uploadify to work with Rails 3. However, I am unable to insert middleware with the correct arguments.
This is the Rails 2 way:
ActionController::Dispatcher.middleware.insert_before(
ActionController::Session::CookieStore,
FlashSessionCookieMiddleware,
ActionController::Base.session_options[:key]
)
This is what I have done so far for Rails 3:
Rails.application.config.middleware.insert_before(
Rails.application.config.session_store,
FlashSessionCookieMiddleware,
Rails.application.config.session_options[:key]
)
However, this gives:
kevin$hephaestus:$exposure [1035 | 0]% rake middleware
(in /Users/kevin/Projects/exposure)
rake aborted!
protected method `session_options' called for #<Rails::Application::Configuration:0x101eb28d0>
(See full trace by running task with --trace)
zsh: exit 1 rake middleware
When I comment out the argument session_options
, the middleware was inserted successfully, but it can't do what it should.
Any suggestions?
+2
a source to share
1 answer
I realize this post is 4 months old, but I ran into some problems solving this problem by adding middleware on Rails 3. Below is the correct way to accomplish this in Rails 3:
Rails.application.config.middleware.insert_before(
ActionDispatch::Session::CookieStore,
FlashSessionCookieMiddleware,
Rails.application.config.session_options[:key]
)
+1
a source to share