Bad Example

drewyoung1 Oct 10, 2012 1 thank

@nZifnab it is a bad example because an included module is basically a class.

module Mod
  def exit(code = 0)
      puts "Exiting with code #{code}"
      super
  end
end

include Mod

exit 99

produces

Exiting with code 99

Send with filename

jassa Oct 7, 2012

The Content-Disposition response header holds the suggested attachment filename (i.e. "attachment; filename=fname.ext")

Set the +:disposition+ option to pass this name.

=== Controller

http = Net::HTTP.new(@page.host)
res = http.post(path, info.to_query, headers)
send_data res, :conten...

Clarification with use of update_all

newdark Oct 2, 2012

I would like to point out that if you are on rails 2.3.11 or lower you will not be able to run ledermann code.

==== Ledermann Code user.messages.update_all(:read => true)

If you are running 2.3 or later it you will have to use James code

==== James Code

Message.update_all({:read => true...