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.
118728039280884af9c112b05b543a50?d=identicon&s=25 unknown (Guest)
on 2006-06-01 12: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   <dam@cosinux.org>
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.
7223c62b7310e164eb79c740188abbda?d=identicon&s=25 Xavier Noria (Guest)
on 2006-06-01 23: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
118728039280884af9c112b05b543a50?d=identicon&s=25 unknown (Guest)
on 2006-06-02 09:20
(Received via mailing list)
On Thu, Jun 01, 2006 at 11:23:26PM +0200, Xavier Noria 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   <dam@cosinux.org>
http://blog.cosinux.org/

Chuck Norris is currently suing NBC, claiming Law and Order are
       trademarked names for his left and right legs.
8b3a5fa50d63275c5c6e304f1a081bfb?d=identicon&s=25 Tim Lucas (Guest)
on 2006-06-02 13: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 Noria 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
7223c62b7310e164eb79c740188abbda?d=identicon&s=25 Xavier Noria (Guest)
on 2006-06-02 17:48
(Received via mailing list)
On Jun 2, 2006, at 13:05, Tim Lucas 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
A2b2f4ee23989dc68529baef9cbddcd6?d=identicon&s=25 Julian 'Julik' Tarkhanov (Guest)
on 2006-06-02 18: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.