[Nitro] Re: fixed boolean

George Moschovitis george.moschovitis at gmail.com
Thu Jan 27 10:41:34 EST 2005


> Could you give a little example on how you generate just a session-id?

Sure:

  # Calculates a unique id.
  #
  # The session id must be unique, a monotonically 
  # increasing function like time is appropriate. Random 
  # may produce equal ids? add a prefix (SALT) to stop 
  # hackers from creating session_ids.
  
  def create_id
    now = Time.now
    md5 = Digest::MD5.new
    md5.update(now.to_s)
    md5.update(now.usec.to_s)
    md5.update(rand(0).to_s)
    md5.update(Session.session_id_salt)
    md5.hexdigest
  end

> I've now taken a look at your FormBuilder. How exactly can I define
> those meta-attributes? I saw, you use meta[:ui] == :textarea...
> Ah sorry, I found it already myself:
> 
>    prop_accessor :attr, :ui => :textarea
> 
> will do.

As you can see the FormBuilder is under construction, If you have any
good ideas, let me know :) I do have some cool ideas for this, you
will see in Nitro 0.10.0 :)

regards,
George.

-- 
www.rubyforge.com/projects/nitro
www.joy.gr



More information about the Nitro-general mailing list