Sha256: fd50d3349aab149a4c2db9fdf64a45b2970b0832f4580a2d4d602e31b478c1f2
Contents?: true
Size: 564 Bytes
Versions: 40
Compression:
Stored size: 564 Bytes
Contents
This allows you to auto focus the page to the first form field. To use this, conditionally include the .js file in your layout via something like: <%= javascript_include_tag('scaffold_form_focus') if @scaffold_options %> The if statement makes it take effect for the scaffolded pages (which always define @scaffold_options). Note that the code is fairly simplistic, it just focuses on the first text input, password input, textarea, or select box on the page, so if your layout has a form before the scaffolded form, you'll probably want to modify the code.
Version data entries
40 entries across 40 versions & 1 rubygems