Skip to content

Instantly share code, notes, and snippets.

@alexslade
Created March 20, 2017 16:32
Show Gist options
  • Save alexslade/fe9828d0e28771cb33de0d29c2eb2941 to your computer and use it in GitHub Desktop.
Save alexslade/fe9828d0e28771cb33de0d29c2eb2941 to your computer and use it in GitHub Desktop.
class AlbumForm < Reform::Form
property :title, prerender: ->(options) { self.title = options[:def_title] }
end
You can then pass arbitrary arguments to prerender!.
###
form.title #=> nil
form.prerender!(def_title: "Roxanne")
form.title #=> "Roxanne"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment