Skip to content

Instantly share code, notes, and snippets.

@kuruma-gs
Created November 29, 2011 06:52
Show Gist options
  • Save kuruma-gs/1403770 to your computer and use it in GitHub Desktop.
Save kuruma-gs/1403770 to your computer and use it in GitHub Desktop.
app/inputs/enum_input.rb
class EnumInput < Formtastic::Inputs::SelectInput
def collection
enum = @object.enums(@method.to_sym)
choices = enum ? enum.select_options : []
end
end
class EnumInput < FormtasticBootstrap::Inputs::SelectInput
def collection
enum = @object.enums(@method.to_sym)
choices = enum ? enum.select_options : []
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment