Skip to content

Commit

Permalink
adds info to README
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonfb committed Mar 6, 2022
1 parent d3e029c commit c839932
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,13 @@ Please note that this example would produce non-functional code, so you would ne
You don't need this if the pluralized version is just + "s" of the singular version. Only use for non-standard plurlizations, and be sure to pass it as TitleCase (as if you pluralized the model name which is non-standard for Rails)


### `--form-labels-position` (default: `after`; options are **before**, **after**, and **omit**)
By default form labels appear after the form inputs. To make them appear before or omit them, use this flag.

See also `--form-placeholder-labels` to use placeolder labels.



### `--exclude=`
(separate field names by COMMA)

Expand Down Expand Up @@ -680,6 +687,13 @@ Omits list LABEL itself above the list. (Do not confuse with the field labels.)

Note that list labels may be automatically omitted on downnested scaffolds.

### `--form-placeholder-labels` (default: false)

When set to true, fields, numbers, and text areas will have placeholder labels.
Will not apply to dates, times, datetimes, dropdowns (enums + foreign keys), or booleans.

See also setting `--form-labels-position` to control position or omit normal labels.

### `--no-list-heading`

Omits the heading of column names that appears above the 1st row of data.
Expand Down
5 changes: 3 additions & 2 deletions lib/generators/hot_glue/scaffold_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,10 @@ class ScaffoldGenerator < Erb::Generators::ScaffoldGenerator
class_option :form_labels_position, default: 'after' # choices are before, after, omit
class_option :form_placeholder_labels, default: false # puts the field names into the placeholder labels


# NOT YET IMPLEMENTED
# determines if labels appear within the rows of the VIEWABLE list (does NOT affect the list heading)
class_option :inline_list_labels, default: 'omit' # choices are before, after, omit
# class_option :inline_list_labels, default: 'omit' # choices are before, after, omit

def initialize(*meta_args)
super
Expand Down Expand Up @@ -170,7 +172,6 @@ def initialize(*meta_args)
if !options['markup'].nil?
message = "Using --markup flag in the generator is deprecated; instead, use a file at config/hot_glue.yml with a key markup set to `erb` or `haml`"
raise(HotGlue::Error, message)

end

if !options['markup'].nil?
Expand Down

0 comments on commit c839932

Please sign in to comment.