Wednesday, 21 March 2012

extract_options! usage


In one of my method in my code, I have seen the method "extract_options!"

 def fields_for(record_name, *args, &block)
      options = args.extract_options!
-----
-----
-----
 end

Its mainly used for removing the hash from the array from the last postion if exists and return the array.


Thank You,
Uma Mahesh

No comments:

Post a Comment