[ANN] History plugin

Hello,

I felt annoyed enough when having to redirect user back to their
previous location in a hackish way that I wrote this plugin.

It avoids storing POST and Ajax request. It also has a facility to
specify actions not to store in the history.

If you are interested, it’s there:
http://blog.cosinux.org/pages/rails-history

See you all,

Damien


Damien MERENNE [email protected]
http://blog.cosinux.org/

If you ask Chuck Norris what time it is, he always says, “Two seconds
'til.”
After you ask, “Two seconds 'til what?” he roundhouse kicks you in the
face.

On Jun 1, 2006, at 12:33, Damien MERENNE wrote:

http://blog.cosinux.org/pages/rails-history
Cool!

Looked to me like a good plugin to explain those metaprogramming
idioms. I blogged about it here:

Advogato: Blog for fxn

– fxn

On Thu, Jun 01, 2006 at 11:23:26PM +0200, Xavier N. wrote:

Looked to me like a good plugin to explain those metaprogramming
idioms. I blogged about it here:

Advogato: Blog for fxn

Thank you very much! I did not thought it could serve as tutorial.
Great article.


Damien MERENNE [email protected]
http://blog.cosinux.org/

Chuck Norris is currently suing NBC, claiming Law and Order are
trademarked names for his left and right legs.

On 02/06/2006, at 5:20 PM, Damien MERENNE wrote:

On Thu, Jun 01, 2006 at 11:23:26PM +0200, Xavier N. wrote:

Looked to me like a good plugin to explain those metaprogramming
idioms. I blogged about it here:

Advogato: Blog for fxn

Thank you very much! I did not thought it could serve as tutorial.
Great article.

Quick point, as Xavier’s diary doesn’t support comments.

Module#append_features is deprecated. Module#included is the new kid
on the block, and no need to call super!

def self.included(base)
base.extend(ClassMethods)
end

– tim lucas

On 1-jun-2006, at 12:33, Damien MERENNE wrote:

http://blog.cosinux.org/pages/rails-history
Damien, I have implemented a similar plugin a while ago, it’s called
Track. Maybe we could just fuse them into one?

http://julik.textdriven.com/svn/tools/rails_plugins/track/

Julian ‘Julik’ Tarkhanov
please send all personal mail to
me at julik.nl

On Jun 2, 2006, at 13:05, Tim L. wrote:

Quick point, as Xavier’s diary doesn’t support comments.

Module#append_features is deprecated. Module#included is the new
kid on the block, and no need to call super!

def self.included(base)
base.extend(ClassMethods)
end

Thank you!

Is there a reason to call class_eval inside history()?

def history(options)
logger.debug(“history: setting up history”)
include History::InstanceMethods
class_eval do
ActionController::Base.history_container =
History::Container.new(options)
after_filter :store_location
end
end

Wouldn’t that code work without class_eval? (See mock-up below, where
croak is after_filter, and tryme is history)

– fxn

class Base
def self.croak
puts “croak! in #{self}”
end
end

module M1
def self.included(base)
base.extend(M2)
end

module M2
def tryme
croak
end
end
end

class Base
include M1
end

Base.tryme # -> croak! in Base