Skip to content

Instantly share code, notes, and snippets.

@olvap
Created May 13, 2010 17:50
Show Gist options
  • Save olvap/400131 to your computer and use it in GitHub Desktop.
Save olvap/400131 to your computer and use it in GitHub Desktop.
#in the model
class Mymodel < ActiveRecord::Base
named_scope :periodos, lambda{
|*args|{
:conditions => ['periodo >=? and periodo <=?',args.first ||0,args.second || 99999 ]
}
}
end
#view
--- form
<%= f.text_field :periodos,:size =>8 %>
--- end form
# how do i send the second parameter?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment