Forum: Ruby on Rails [ANN] History plugin

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
unknown (Guest)
on 2006-06-01 14:34
(Received via mailing list)
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   <removed_email_address@domain.invalid>
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.
Xavier N. (Guest)
on 2006-06-02 01:26
(Received via mailing list)
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:

   http://advogato.org/person/fxn/diary.html?start=441

-- fxn
unknown (Guest)
on 2006-06-02 11:20
(Received via mailing list)
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:
>
>   http://advogato.org/person/fxn/diary.html?start=441

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


--
Damien MERENNE   <removed_email_address@domain.invalid>
http://blog.cosinux.org/

Chuck Norris is currently suing NBC, claiming Law and Order are
       trademarked names for his left and right legs.
Tim L. (Guest)
on 2006-06-02 15:07
(Received via mailing list)
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:
>>
>>   http://advogato.org/person/fxn/diary.html?start=441
>
> 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
Xavier N. (Guest)
on 2006-06-02 19:48
(Received via mailing list)
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
Julian 'Julik' Tarkhanov (Guest)
on 2006-06-02 20:27
(Received via mailing list)
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
This topic is locked and can not be replied to.