相关疑难解决方法(0)

如何在simple_form中使用占位符而不是标签?

我想在我的应用程序中使用占位符而不是标签.我使用的是simple_form和Rails(3.2.14).如何在simple_form配置文件中指定使用占位符而不是标签.

在Initializers中有一个文件simple_form.rb即

# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
  # Wrappers are used by the form builder to generate a
  # complete input. You can remove any component from the
  # wrapper, change the order or even add your own to the
  # stack. The options given below are used to wrap the
  # whole input.
  config.wrappers :default, :class => :input, :hint_class => :field_with_hint, :error_class => :field_with_errors do |b|
    ## Extensions enabled …
Run Code Online (Sandbox Code Playgroud)

label ruby-on-rails placeholder simple-form

21
推荐指数
2
解决办法
1万
查看次数

标签 统计

label ×1

placeholder ×1

ruby-on-rails ×1

simple-form ×1