Rails 3 Flash Uploader

Posted by klynch on Stack Overflow See other posts from Stack Overflow or by klynch
Published on 2010-04-23T18:01:27Z Indexed on 2010/04/23 18:03 UTC
Read the original article Hit count: 459

Filed under:
|

I am trying to get Uploadify working with Rails 3. However, I can't insert the 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 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 session_options argument, the middleware is successfully inserted, but it can't do what it is supposed to.

Any suggestions?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby