Skip to content

Commit

Permalink
added an install generator for the initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Forkin committed Aug 1, 2015
1 parent effb0ea commit 8f750c2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,15 @@ Mustache form has an install generator that creates an initializer allowing you
options. For now the only option is to enable the SimpleForm support globally. Basically this means
that when this option is turned on - then the simple_form helper will always be used.

You can safely turn this on if you are using simple_form as you can also turn it off for individual
forms, see below:

```
rails generate mustache_form:install
```


You can safely turn this on if you are using simple_form as you can also turn it off for individual
forms, see below:


## Usage

Expand Down
12 changes: 12 additions & 0 deletions lib/generators/mustache_form/install_generator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module MustacheForm
module Generators
class InstallGenerator < Rails::Generators::Base
desc "Copy MustacheForm initializer"
source_root File.expand_path('../templates', __FILE__)

def copy_config
template "config/initializers/mustache_form.rb"
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#
MustacheForm.setup do |config|
#
# - by default simple_form is not enabled
#
config.simple_form_enabled = false
end
2 changes: 1 addition & 1 deletion lib/mustache_form/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module MustacheForm
VERSION = "0.2.1"
VERSION = "0.2.2"
end

0 comments on commit 8f750c2

Please sign in to comment.