Skip to content

Instantly share code, notes, and snippets.

@reu
Created September 17, 2010 20:56
Show Gist options
  • Save reu/584932 to your computer and use it in GitHub Desktop.
Save reu/584932 to your computer and use it in GitHub Desktop.
require "ostruct"
module FormsHelper
def search_form_for(object_name, options={}, &block)
options[:html] = {:method => :get}.update(options[:html] || {})
object = OpenStruct.new(params[object_name])
form_for(object_name, object, options, &block)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment