Module: Hibiki::Rails::Generators::ScaffoldViewHelpers
- Included in:
- ScaffoldControllerGenerator
- Defined in:
- lib/generators/hibiki/rails/scaffold_view_helpers.rb
Overview
How a generated view's argument lists are assembled.
These live here rather than in the templates because of --css=none. A
<% if css? %> guard around a class: line works, but it forces that
argument onto a line of its own and drags everything after it along —
the emitted markup then wraps nothing like what a person would write.
Building the list in Ruby and wrapping it once keeps --css=none clean
AND the styled variants naturally packed.
Depends on the generator for #css, #css?, #schema and the naming helpers; it is a mixin, not a standalone object.
Constant Summary collapse
- FIELD_TOKENS =
Which css token dresses a field. The two forms differ by one entry: the classic form_with select is unwidened, the inline one is full width — a difference the hand-built variants have in all three stylesheets, so it is real rather than an oversight.
{ string: :input_full, text: :textarea_full, boolean: :toggle }.freeze