Skip to content

Commit

Permalink
updated the documentation and hence to release a minor version number…
Browse files Browse the repository at this point in the history
… update
  • Loading branch information
Steve Forkin committed Mar 31, 2015
1 parent 31a3e11 commit 0fe5b49
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
listly (0.1.3)
listly (0.1.4)
rails (>= 4.1.1)

GEM
Expand Down
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module YourRailsApp
class Application < Rails::Application
...
config.listly.listly_store_location = :local_list_store
config.listly.listly_constants_module = :local_list_constants
config.listly.listly_constants_module = :local_list_constants # <--- ModuleName as symbol
...
end
end
Expand All @@ -54,10 +54,10 @@ Here is an example of the module and some sample constants that will be turned i

```ruby

module LocalListConstants
module LocalListConstants # <------ Module name see the symbol "listly_constants_module" above

STATE_TYPES = :state_type_hash
SEX_TYPES = :sex_type_hash
STATE_TYPES = :state_type_hash # <----- see the hash stored in locales below
SEX_TYPES = :sex_type_hash # <----- see the hash stored in locales below

end

Expand All @@ -68,13 +68,13 @@ put the respective data relating to the above constant values.

```ruby

states_hash: [
state_types_hash: [ # <------- Array of hashes - name corresponds to constants see above
{code: 'act', name: 'ACT', desc: 'Australian Capital Teritory'},
{code: 'nsw', name: 'NSW', desc: 'New South Wales'},
{code: 'nt', name: 'NT', desc: 'Northern Teritory'},
{code: 'qld', name: 'QLD', desc: 'Queensland'},
]
sex_types_hash: [
sex_types_hash: [ # <------- Array of hashes - name corresponds to constants see above
{code: 'male', name: 'Male'},
{code: 'female', name: 'Female'},
{code: 'notset', name: 'Not Set'}
Expand Down Expand Up @@ -103,7 +103,8 @@ module Wrapper
include PageHeader
include Mustache::FormBuilder
include Wrapper::Person::Form
include SexTypeList # <------ This is the included list module!
include SexTypes # <------ This is the included list module - see the SEX_TYPES
# constant in the LocalListConstants module above

```

Expand All @@ -122,6 +123,13 @@ sex_field: f.collection_select(:sex, all_sex_types, :sex_type_code, :sex_type_na
}
}),

# 'all_sex_types' --> is a listly defined method to get the whole list
# 'sex_type_code' --> is a listly defined attribute on the inner class
# 'sex_type_name' --> is a listly defined attribute on the inner class

# NB: The gem creates attributes from the names of the hash codes and gives the attributes
# values according to the hash values - i.e. from the data in the i18n stored array of hashes!

```

## Development
Expand Down
2 changes: 1 addition & 1 deletion lib/listly/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Listly
VERSION = "0.1.3"
VERSION = "0.1.4"
end

0 comments on commit 0fe5b49

Please sign in to comment.