Class: Suspenders::FormsGenerator

Inherits:
Generators::Base show all
Defined in:
lib/suspenders/generators/forms_generator.rb

Instance Method Summary collapse

Methods inherited from Generators::Base

default_source_root, inherited

Methods included from Actions

#action_mailer_asset_host, #action_mailer_host, #configure_environment, #expand_json, #replace_in_file

Instance Method Details

#add_simple_formObject


5
6
7
8
# File 'lib/suspenders/generators/forms_generator.rb', line 5

def add_simple_form
  gem "simple_form"
  Bundler.with_unbundled_env { run "bundle install" }
end

#configure_simple_formObject


10
11
12
13
14
15
16
# File 'lib/suspenders/generators/forms_generator.rb', line 10

def configure_simple_form
  create_file "config/initializers/simple_form.rb" do
    "SimpleForm.setup {|config|}"
  end

  generate "simple_form:install", "--force"
end