setting response.headers is non-effective?

As far as I know, this should append these headers to the response from Rails no matter what, right?

I've checked in Fierbug in Fierfox 3.5.5 and I only see my usual headers. What might be getting in the way?

#app/controllers/application_controller.rb class ApplicationController < ActionController::Base     after_filter :cors

    def cors       response.headers['Access-Control-Allow-Origin'] == '*'       response.headers['Access-Control-Allow-Methods'] == 'POST, GET, PUT, DELETE, OPTIONS, HEAD'       response.headers['Access-Control-Allow-Credentials'] == 'true'       response.headers['Access-Control-Allow-Headers'] == 'X- PINGOTHER'       response.headers['Access-Control-Max-Age'] == '86400' # 24 hours     end end

your way is correct.

http://guides.rubyonrails.org/action_controller_overview.html#other-ways-to-use-filters

9.2.1 Setting Custom Headers

If you want to set custom headers for a response then response.headers is the place to do it. The headers attribute is a hash which maps header names to their values, and Rails will set some of them automatically. If you want to add or change a header, just assign it to response.headers this way:

response.headers["Content-Type"] = "application/pdf"

As far as I know, this should append these headers to the response from Rails no matter what, right?

I've checked in Fierbug in Fierfox 3.5.5 and I only see my usual headers. What might be getting in the way?

Because this is Ruby, not C?

Use = for assignment, not ==

Surely?

Both Ruby and C use the == operator to test that the rvalue equals the lvalue, as in: this_email_message == pedantic

Ruby uses both = and => as assignment operators, depending on the situation. Of course this prompts the student to ask, are two assignment operators enough?

Both Ruby and C use the == operator to test that the rvalue equals the lvalue, as in: this_email_message == pedantic

Ruby uses both = and => as assignment operators, depending on the situation. Of course this prompts the student to ask, are two assignment operators enough?

or how many equality operators are enough ( ==, .eql?, .equal?, === (sort of))

Fred

Use = for assignment, not ==

Thank you!

What I needed was a fresh set of eyes!