bootstrap-generators 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. data/README.md +15 -0
  2. data/bootstrap-generators.gemspec +7 -5
  3. data/lib/bootstrap-generators.rb +7 -31
  4. data/lib/bootstrap/generators/engine.rb +5 -0
  5. data/lib/bootstrap/generators/railtie.rb +5 -0
  6. data/lib/{bootstrap-generators → bootstrap/generators}/version.rb +1 -1
  7. data/lib/generators/bootstrap/install/install_generator.rb +28 -0
  8. data/lib/generators/bootstrap/install/templates/app/inputs/boolean_input.rb +11 -0
  9. data/lib/generators/bootstrap/install/templates/app/inputs/date_time_input.rb +11 -0
  10. data/lib/generators/bootstrap/install/templates/app/inputs/mapping_input.rb +11 -0
  11. data/lib/generators/bootstrap/install/templates/app/inputs/string_input.rb +11 -0
  12. data/lib/generators/bootstrap/install/templates/app/inputs/text_input.rb +11 -0
  13. data/lib/generators/{layout → bootstrap/install/templates}/application.html.erb +11 -5
  14. data/lib/generators/bootstrap/install/templates/bootstrap-generators.css.scss +21 -0
  15. data/lib/generators/bootstrap/install/templates/bootstrap-generators.js +1 -0
  16. data/lib/generators/bootstrap/install/templates/config/initializers/simple_form.rb +93 -0
  17. data/lib/generators/bootstrap/install/templates/lib/templates/erb/scaffold/_form.html.erb +17 -0
  18. data/lib/generators/bootstrap/install/templates/lib/templates/erb/scaffold/edit.html.erb +7 -0
  19. data/lib/generators/{erubis/scaffold/templates → bootstrap/install/templates/lib/templates/erb/scaffold}/index.html.erb +1 -2
  20. data/lib/generators/{erubis/scaffold/templates → bootstrap/install/templates/lib/templates/erb/scaffold}/new.html.erb +1 -3
  21. data/lib/generators/bootstrap/install/templates/lib/templates/erb/scaffold/show.html.erb +13 -0
  22. data/vendor/assets/javascripts/bootstrap.js +1 -0
  23. metadata +54 -36
  24. data/lib/bootstrap-generators/engine.rb +0 -6
  25. data/lib/generators/erubis.rb +0 -10
  26. data/lib/generators/erubis/controller/controller_generator.rb +0 -11
  27. data/lib/generators/erubis/controller/templates/view.html.erb +0 -3
  28. data/lib/generators/erubis/scaffold/scaffold_generator.rb +0 -24
  29. data/lib/generators/erubis/scaffold/templates/_form.html.erb +0 -24
  30. data/lib/generators/erubis/scaffold/templates/edit.html.erb +0 -9
  31. data/lib/generators/erubis/scaffold/templates/show.html.erb +0 -13
  32. data/lib/generators/layout/bootstrap-layout.css +0 -3
data/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # Bootstrap Generators
2
+
3
+ ## Installation
4
+
5
+ Add it to your Gemfile:
6
+
7
+ `gem "bootstrap-generators"`
8
+
9
+ Add simple_form to your Gemfile
10
+
11
+ `gem "simple_form"`
12
+
13
+ Run the generator:
14
+
15
+ `rails generate bootstrap:install`
@@ -1,13 +1,13 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
- require "bootstrap-generators/version"
3
+ require "bootstrap/generators/version"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "bootstrap-generators"
7
7
  s.version = Bootstrap::Generators::VERSION
8
8
  s.authors = ["Décio Ferreira"]
9
9
  s.email = ["decio.ferreira@decioferreira.com"]
10
- s.homepage = ""
10
+ s.homepage = "https://github.com/decioferreira/bootstrap-generators"
11
11
  s.summary = %q{Bootstrap-generators provides Twitter Bootstrap generators for Rails 3.}
12
12
  s.description = %q{Bootstrap-generators provides Twitter Bootstrap generators for Rails 3. Bootstrap is a toolkit from Twitter designed to kickstart development of webapps and sites. Checkout http://twitter.github.com/bootstrap.}
13
13
 
@@ -22,8 +22,10 @@ Gem::Specification.new do |s|
22
22
  # s.add_development_dependency "rspec"
23
23
  # s.add_runtime_dependency "rest-client"
24
24
 
25
- s.add_dependency "railties", ">= 3.0.0"
26
- s.add_development_dependency "bundler", ">= 1.0.0"
25
+ s.add_development_dependency "bundler", "~> 1.0.0"
27
26
  s.add_development_dependency "test-unit"
28
- s.add_development_dependency "rails", ">= 3.0.0"
27
+ s.add_development_dependency "rails", "~> 3.0"
28
+
29
+ s.add_runtime_dependency "railties", "~> 3.0"
30
+ s.add_runtime_dependency "simple_form", "~> 1.5.0"
29
31
  end
@@ -1,37 +1,13 @@
1
- require 'rails'
2
- require 'rails/generators'
3
-
4
- module BootstrapGenerators
5
- module Rails
1
+ module Bootstrap
2
+ module Generators
6
3
  class Railtie < ::Rails::Railtie
7
- if ::Rails.version.to_f >= 3.1
8
- # Erubis has the default template engine
9
- config.app_generators.template_engine :erubis
10
- config.app_generators.stylesheets false
11
- require 'bootstrap-generators/engine'
4
+ if ::Rails.version < "3.1"
5
+ require 'bootstrap/generators/railtie'
12
6
  else
13
- # Erubis has the default template engine
14
- config.generators.template_engine :erubis
7
+ config.app_generators.stylesheets false
8
+ require 'bootstrap/generators/engine'
15
9
  end
16
- end
17
- end
18
-
19
- class LayoutGenerator < ::Rails::Generators::Base
20
- desc "This generator installs Twitter Bootstrap Layout"
21
- source_root File.expand_path('../generators/layout', __FILE__)
22
-
23
- def copy_layout
24
- say_status("copying", "layout", :green)
25
- copy_file "application.html.erb", "app/views/layouts/application.html.erb"
26
- end
27
-
28
- def copy_stylesheet
29
- say_status("copying", "layout stylesheet", :green)
30
- copy_file "bootstrap-layout.css", "app/assets/stylesheets/bootstrap-layout.css"
10
+ require 'bootstrap/generators/version'
31
11
  end
32
12
  end
33
13
  end
34
-
35
- Rails::Generators.hidden_namespaces << 'rails'
36
- Rails::Generators.hidden_namespaces << 'erb:controller' << 'erb:scaffold'
37
- Rails::Generators.hidden_namespaces << 'erubis:controller' << 'erubis:scaffold'
@@ -0,0 +1,5 @@
1
+ module Bootstrap
2
+ module Generators
3
+ class Engine < ::Rails::Engine; end
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module Bootstrap
2
+ module Generators
3
+ class Engine < ::Rails::Engine; end
4
+ end
5
+ end
@@ -1,5 +1,5 @@
1
1
  module Bootstrap
2
2
  module Generators
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -0,0 +1,28 @@
1
+ require 'rails'
2
+
3
+ module Bootstrap
4
+ module Generators
5
+ class InstallGenerator < ::Rails::Generators::Base
6
+ desc "Copy BootstrapGenerators default files"
7
+ source_root File.expand_path('../templates', __FILE__)
8
+
9
+ def copy_simple_form_inputs
10
+ directory 'app'
11
+ end
12
+
13
+ def copy_simple_form_config
14
+ directory 'config'
15
+ end
16
+
17
+ def copy_lib
18
+ directory 'lib'
19
+ end
20
+
21
+ def create_layout
22
+ template 'application.html.erb', 'app/views/layouts/application.html.erb'
23
+ copy_file 'bootstrap-generators.css.scss', 'app/assets/stylesheets/bootstrap-generators.css.scss'
24
+ copy_file 'bootstrap-generators.js', 'app/assets/javascripts/bootstrap-generators.js'
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,11 @@
1
+ class BooleanInput < SimpleForm::Inputs::BooleanInput
2
+ def label_input
3
+ content = "".html_safe
4
+ [ :input, :error, :hint ].each do |component|
5
+ next if options[component] == false
6
+ rendered = send(component)
7
+ content.safe_concat rendered.to_s if rendered
8
+ end
9
+ (options[:label] == false ? "" : label) + "<div class=\"input\"><ul class=\"inputs-list\"><li><label>#{content}</label></li></ul></div>".html_safe
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ class DateTimeInput < SimpleForm::Inputs::DateTimeInput
2
+ def label_input
3
+ content = "".html_safe
4
+ [ :input, :error, :hint ].each do |component|
5
+ next if options[component] == false
6
+ rendered = send(component)
7
+ content.safe_concat rendered.to_s if rendered
8
+ end
9
+ (options[:label] == false ? "" : label) + "<div class=\"input\">#{content}</div>".html_safe
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ class MappingInput < SimpleForm::Inputs::MappingInput
2
+ def label_input
3
+ content = "".html_safe
4
+ [ :input, :error, :hint ].each do |component|
5
+ next if options[component] == false
6
+ rendered = send(component)
7
+ content.safe_concat rendered.to_s if rendered
8
+ end
9
+ (options[:label] == false ? "" : label) + "<div class=\"input\">#{content}</div>".html_safe
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ class StringInput < SimpleForm::Inputs::StringInput
2
+ def label_input
3
+ content = "".html_safe
4
+ [ :input, :error, :hint ].each do |component|
5
+ next if options[component] == false
6
+ rendered = send(component)
7
+ content.safe_concat rendered.to_s if rendered
8
+ end
9
+ (options[:label] == false ? "" : label) + "<div class=\"input\">#{content}</div>".html_safe
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ class TextInput < SimpleForm::Inputs::TextInput
2
+ def label_input
3
+ content = "".html_safe
4
+ [ :input, :error, :hint ].each do |component|
5
+ next if options[component] == false
6
+ rendered = send(component)
7
+ content.safe_concat rendered.to_s if rendered
8
+ end
9
+ (options[:label] == false ? "" : label) + "<div class=\"input\">#{content}</div>".html_safe
10
+ end
11
+ end
@@ -11,15 +11,15 @@
11
11
  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
12
12
  <![endif]-->
13
13
 
14
- <%= stylesheet_link_tag "application" %>
15
- <%= javascript_include_tag "application" %>
16
- <%= csrf_meta_tags %>
14
+ <%%= stylesheet_link_tag "application" %>
15
+ <%%= javascript_include_tag "application" %>
16
+ <%%= csrf_meta_tags %>
17
17
  </head>
18
18
  <body>
19
19
  <div class="topbar">
20
20
  <div class="fill">
21
21
  <div class="container">
22
- <a class="brand" href="#">Project name</a>
22
+ <%%= link_to "Project name", "#", :class => "brand" %>
23
23
  <ul class="nav">
24
24
  <li class="active"><a href="#">Home</a></li>
25
25
  <li><a href="#about">About</a></li>
@@ -28,10 +28,16 @@
28
28
  </div>
29
29
  </div>
30
30
  </div>
31
+ <%% flash.each do |name, msg| %>
32
+ <%%= content_tag :div, :class => "container alert-message #{name == :error ? "error" : "success" }", :"data-alert" => "alert" do %>
33
+ <a class="close" href="#">×</a>
34
+ <p><%%= msg %></p>
35
+ <%% end %>
36
+ <%% end %>
31
37
  <div class="container">
32
38
  <div class="row">
33
39
  <div class="span16">
34
- <%= yield %>
40
+ <%%= yield %>
35
41
  </div>
36
42
  </div>
37
43
  <footer>
@@ -0,0 +1,21 @@
1
+ /*
2
+ *= require bootstrap
3
+ */
4
+
5
+ body {
6
+ padding-top: 60px;
7
+ }
8
+
9
+ .page-header {
10
+ a.btn {
11
+ float: right;
12
+ }
13
+
14
+ a.btn + a.btn {
15
+ margin-right: 8px;
16
+ }
17
+ }
18
+
19
+ .form-stacked div.alert-message {
20
+ margin-left: -10px;
21
+ }
@@ -0,0 +1 @@
1
+ //= require bootstrap
@@ -0,0 +1,93 @@
1
+ # Use this setup block to configure all options available in SimpleForm.
2
+ SimpleForm.setup do |config|
3
+ # Components used by the form builder to generate a complete input. You can remove
4
+ # any of them, change the order, or even add your own components to the stack.
5
+ config.components = [ :placeholder, :label_input ]
6
+
7
+ # Default tag used on hints.
8
+ # config.hint_tag = :span
9
+
10
+ # CSS class to add to all hint tags.
11
+ config.hint_class = :"help-block"
12
+
13
+ # CSS class used on errors.
14
+ config.error_class = :"help-inline"
15
+
16
+ # Default tag used on errors.
17
+ # config.error_tag = :span
18
+
19
+ # Method used to tidy up errors.
20
+ # config.error_method = :first
21
+
22
+ # Default tag used for error notification helper.
23
+ # config.error_notification_tag = :p
24
+
25
+ # CSS class to add for error notification helper.
26
+ # config.error_notification_class = :error_notification
27
+
28
+ # ID to add for error notification helper.
29
+ # config.error_notification_id = nil
30
+
31
+ # You can wrap all inputs in a pre-defined tag.
32
+ # config.wrapper_tag = :div
33
+
34
+ # CSS class to add to all wrapper tags.
35
+ config.wrapper_class = :clearfix
36
+
37
+ # CSS class to add to the wrapper if the field has errors.
38
+ config.wrapper_error_class = :error
39
+
40
+ # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
41
+ # config.collection_wrapper_tag = nil
42
+
43
+ # You can wrap each item in a collection of radio/check boxes with a tag, defaulting to span.
44
+ # config.item_wrapper_tag = :span
45
+
46
+ # Series of attempts to detect a default label method for collection.
47
+ # config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
48
+
49
+ # Series of attempts to detect a default value method for collection.
50
+ # config.collection_value_methods = [ :id, :to_s ]
51
+
52
+ # How the label text should be generated altogether with the required text.
53
+ # config.label_text = lambda { |label, required| "#{required} #{label}" }
54
+
55
+ # You can define the class to use on all labels. Default is nil.
56
+ # config.label_class = nil
57
+
58
+ # You can define the class to use on all forms. Default is simple_form.
59
+ # config.form_class = :"form-stacked"
60
+
61
+ # Whether attributes are required by default (or not). Default is true.
62
+ # config.required_by_default = true
63
+
64
+ # Tell browsers whether to use default HTML5 validations (novalidate option).
65
+ # Default is enabled.
66
+ # config.browser_validations = true
67
+
68
+ # Determines whether HTML5 types (:email, :url, :search, :tel) and attributes
69
+ # (e.g. required) are used or not. True by default.
70
+ # Having this on in non-HTML5 compliant sites can cause odd behavior in
71
+ # HTML5-aware browsers such as Chrome.
72
+ # config.html5 = true
73
+
74
+ # Custom mappings for input types. This should be a hash containing a regexp
75
+ # to match as key, and the input type that will be used when the field name
76
+ # matches the regexp as value.
77
+ # config.input_mappings = { /count/ => :integer }
78
+
79
+ # Collection of methods to detect if a file type was given.
80
+ # config.file_methods = [ :mounted_as, :file?, :public_filename ]
81
+
82
+ # Default priority for time_zone inputs.
83
+ # config.time_zone_priority = nil
84
+
85
+ # Default priority for country inputs.
86
+ # config.country_priority = nil
87
+
88
+ # Default size for text inputs.
89
+ # config.default_input_size = 50
90
+
91
+ # When false, do not use translations for labels, hints or placeholders.
92
+ # config.translate = true
93
+ end
@@ -0,0 +1,17 @@
1
+ <%%= simple_form_for(@<%= singular_table_name %>) do |f| %>
2
+ <%% if f.object.errors.any? %>
3
+ <div class="alert-message error">
4
+ <%%= f.error_notification %>
5
+ </div>
6
+ <%% end %>
7
+
8
+ <div class="inputs">
9
+ <%- attributes.each do |attribute| -%>
10
+ <%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %>, :input_html => { :class => '<%= [:datetime_select, :date_select].include?(attribute.field_type) ? 'small' : 'xxlarge' %>' } %>
11
+ <%- end -%>
12
+ </div>
13
+
14
+ <div class="actions">
15
+ <%%= f.button :submit, :class => "btn primary" %>
16
+ </div>
17
+ <%% end %>
@@ -0,0 +1,7 @@
1
+ <div class="page-header">
2
+ <%%= link_to 'Back', <%= index_helper %>_path, :class => 'btn' %>
3
+ <%%= link_to 'Show', @<%= singular_table_name %>, :class => 'btn primary' %>
4
+ <h1>Editing <%= singular_table_name %></h1>
5
+ </div>
6
+
7
+ <%%= render 'form' %>
@@ -1,5 +1,5 @@
1
1
  <div class="page-header">
2
- <%%= link_to 'New <%= human_name %>', new_<%= singular_table_name %>_path, :class => 'btn' %>
2
+ <%%= link_to 'New <%= human_name %>', new_<%= singular_table_name %>_path, :class => 'btn primary' %>
3
3
  <h1>Listing <%= plural_table_name %></h1>
4
4
  </div>
5
5
 
@@ -28,4 +28,3 @@
28
28
  <%% end %>
29
29
  </tbody>
30
30
  </table>
31
-
@@ -1,8 +1,6 @@
1
1
  <div class="page-header">
2
+ <%%= link_to 'Back', <%= index_helper %>_path, :class => 'btn' %>
2
3
  <h1>New <%= singular_table_name %></h1>
3
4
  </div>
4
5
 
5
6
  <%%= render 'form' %>
6
-
7
- <%%= link_to 'Back', <%= index_helper %>_path %>
8
-
@@ -0,0 +1,13 @@
1
+ <div class="page-header">
2
+ <%%= link_to 'Back', <%= index_helper %>_path, :class => 'btn' %>
3
+ <%%= link_to 'Edit', edit_<%= singular_table_name %>_path(@<%= singular_table_name %>), :class => 'btn primary' %>
4
+ <h1>Listing <%= plural_table_name %></h1>
5
+ </div>
6
+
7
+ <dl>
8
+ <%- attributes.each do |attribute| -%>
9
+ <dt><%= attribute.human_name %>:</dt>
10
+ <dd><%%= @<%= singular_table_name %>.<%= attribute.name %> %></dd>
11
+
12
+ <%- end -%>
13
+ </dl>
@@ -0,0 +1 @@
1
+ //= require_tree .
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap-generators
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,33 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-07 00:00:00.000000000Z
12
+ date: 2011-10-10 00:00:00.000000000Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: railties
16
- requirement: &2156894940 !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: 3.0.0
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: *2156894940
25
14
  - !ruby/object:Gem::Dependency
26
15
  name: bundler
27
- requirement: &2156894320 !ruby/object:Gem::Requirement
16
+ requirement: &2152295500 !ruby/object:Gem::Requirement
28
17
  none: false
29
18
  requirements:
30
- - - ! '>='
19
+ - - ~>
31
20
  - !ruby/object:Gem::Version
32
21
  version: 1.0.0
33
22
  type: :development
34
23
  prerelease: false
35
- version_requirements: *2156894320
24
+ version_requirements: *2152295500
36
25
  - !ruby/object:Gem::Dependency
37
26
  name: test-unit
38
- requirement: &2156893500 !ruby/object:Gem::Requirement
27
+ requirement: &2152256980 !ruby/object:Gem::Requirement
39
28
  none: false
40
29
  requirements:
41
30
  - - ! '>='
@@ -43,18 +32,40 @@ dependencies:
43
32
  version: '0'
44
33
  type: :development
45
34
  prerelease: false
46
- version_requirements: *2156893500
35
+ version_requirements: *2152256980
47
36
  - !ruby/object:Gem::Dependency
48
37
  name: rails
49
- requirement: &2156891900 !ruby/object:Gem::Requirement
38
+ requirement: &2152255600 !ruby/object:Gem::Requirement
50
39
  none: false
51
40
  requirements:
52
- - - ! '>='
41
+ - - ~>
53
42
  - !ruby/object:Gem::Version
54
- version: 3.0.0
43
+ version: '3.0'
55
44
  type: :development
56
45
  prerelease: false
57
- version_requirements: *2156891900
46
+ version_requirements: *2152255600
47
+ - !ruby/object:Gem::Dependency
48
+ name: railties
49
+ requirement: &2152253880 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ type: :runtime
56
+ prerelease: false
57
+ version_requirements: *2152253880
58
+ - !ruby/object:Gem::Dependency
59
+ name: simple_form
60
+ requirement: &2152253220 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ~>
64
+ - !ruby/object:Gem::Version
65
+ version: 1.5.0
66
+ type: :runtime
67
+ prerelease: false
68
+ version_requirements: *2152253220
58
69
  description: Bootstrap-generators provides Twitter Bootstrap generators for Rails
59
70
  3. Bootstrap is a toolkit from Twitter designed to kickstart development of webapps
60
71
  and sites. Checkout http://twitter.github.com/bootstrap.
@@ -66,22 +77,28 @@ extra_rdoc_files: []
66
77
  files:
67
78
  - .gitignore
68
79
  - Gemfile
80
+ - README.md
69
81
  - Rakefile
70
82
  - bootstrap-generators.gemspec
71
83
  - lib/bootstrap-generators.rb
72
- - lib/bootstrap-generators/engine.rb
73
- - lib/bootstrap-generators/version.rb
74
- - lib/generators/erubis.rb
75
- - lib/generators/erubis/controller/controller_generator.rb
76
- - lib/generators/erubis/controller/templates/view.html.erb
77
- - lib/generators/erubis/scaffold/scaffold_generator.rb
78
- - lib/generators/erubis/scaffold/templates/_form.html.erb
79
- - lib/generators/erubis/scaffold/templates/edit.html.erb
80
- - lib/generators/erubis/scaffold/templates/index.html.erb
81
- - lib/generators/erubis/scaffold/templates/new.html.erb
82
- - lib/generators/erubis/scaffold/templates/show.html.erb
83
- - lib/generators/layout/application.html.erb
84
- - lib/generators/layout/bootstrap-layout.css
84
+ - lib/bootstrap/generators/engine.rb
85
+ - lib/bootstrap/generators/railtie.rb
86
+ - lib/bootstrap/generators/version.rb
87
+ - lib/generators/bootstrap/install/install_generator.rb
88
+ - lib/generators/bootstrap/install/templates/app/inputs/boolean_input.rb
89
+ - lib/generators/bootstrap/install/templates/app/inputs/date_time_input.rb
90
+ - lib/generators/bootstrap/install/templates/app/inputs/mapping_input.rb
91
+ - lib/generators/bootstrap/install/templates/app/inputs/string_input.rb
92
+ - lib/generators/bootstrap/install/templates/app/inputs/text_input.rb
93
+ - lib/generators/bootstrap/install/templates/application.html.erb
94
+ - lib/generators/bootstrap/install/templates/bootstrap-generators.css.scss
95
+ - lib/generators/bootstrap/install/templates/bootstrap-generators.js
96
+ - lib/generators/bootstrap/install/templates/config/initializers/simple_form.rb
97
+ - lib/generators/bootstrap/install/templates/lib/templates/erb/scaffold/_form.html.erb
98
+ - lib/generators/bootstrap/install/templates/lib/templates/erb/scaffold/edit.html.erb
99
+ - lib/generators/bootstrap/install/templates/lib/templates/erb/scaffold/index.html.erb
100
+ - lib/generators/bootstrap/install/templates/lib/templates/erb/scaffold/new.html.erb
101
+ - lib/generators/bootstrap/install/templates/lib/templates/erb/scaffold/show.html.erb
85
102
  - test/fixtures/routes.rb
86
103
  - test/lib/generators/erubis/controller_generator_test.rb
87
104
  - test/lib/generators/erubis/scaffold_generator_test.rb
@@ -93,9 +110,10 @@ files:
93
110
  - vendor/assets/javascripts/bootstrap-scrollspy.js
94
111
  - vendor/assets/javascripts/bootstrap-tabs.js
95
112
  - vendor/assets/javascripts/bootstrap-twipsy.js
113
+ - vendor/assets/javascripts/bootstrap.js
96
114
  - vendor/assets/stylesheets/bootstrap.css
97
115
  - vendor/assets/stylesheets/bootstrap.min.css
98
- homepage: ''
116
+ homepage: https://github.com/decioferreira/bootstrap-generators
99
117
  licenses: []
100
118
  post_install_message:
101
119
  rdoc_options: []
@@ -1,6 +0,0 @@
1
- module BootstrapGenerators
2
- module Rails
3
- class Engine < ::Rails::Engine; end
4
- end
5
- end
6
-
@@ -1,10 +0,0 @@
1
- module Erubis
2
- module Generators
3
- module TemplatePath
4
- def source_root
5
- File.expand_path(File.join(File.dirname(__FILE__), 'erubis', generator_name, 'templates'))
6
- end
7
- end
8
- end
9
- end
10
-
@@ -1,11 +0,0 @@
1
- require 'generators/erubis'
2
- require 'rails/generators/erb/controller/controller_generator'
3
-
4
- module Erubis
5
- module Generators
6
- class ControllerGenerator < Erb::Generators::ControllerGenerator
7
- extend TemplatePath
8
- end
9
- end
10
- end
11
-
@@ -1,3 +0,0 @@
1
- <h1><%= class_name %>#<%= @action %></h1>
2
- <p>Find me in <%= @path %></p>
3
-
@@ -1,24 +0,0 @@
1
- require 'generators/erubis'
2
- require 'rails/generators/erb/scaffold/scaffold_generator'
3
-
4
- module Erubis
5
- module Generators
6
- class ScaffoldGenerator < Erb::Generators::ScaffoldGenerator
7
- extend TemplatePath
8
-
9
- hook_for :form_builder, :as => :scaffold
10
-
11
- def copy_form_file
12
- if options[:form_builder].nil?
13
- filename = filename_with_extensions("_form")
14
- template filename, File.join("app/views", controller_file_path, filename)
15
- end
16
- end
17
-
18
- protected
19
- def available_views
20
- %w(index edit show new)
21
- end
22
- end
23
- end
24
- end
@@ -1,24 +0,0 @@
1
- <%%= form_for(@<%= singular_table_name %>) do |f| %>
2
- <%% if @<%= singular_table_name %>.errors.any? %>
3
- <div id="error_explanation">
4
- <h2><%%= pluralize(@<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:</h2>
5
-
6
- <ul>
7
- <%% @<%= singular_table_name %>.errors.full_messages.each do |msg| %>
8
- <li><%%= msg %></li>
9
- <%% end %>
10
- </ul>
11
- </div>
12
- <%% end %>
13
-
14
- <% attributes.each do |attribute| -%>
15
- <div class="field">
16
- <%%= f.label :<%= attribute.name %> %><br />
17
- <%%= f.<%= attribute.field_type %> :<%= attribute.name %> %>
18
- </div>
19
- <% end -%>
20
- <div class="actions">
21
- <%%= f.submit %>
22
- </div>
23
- <%% end %>
24
-
@@ -1,9 +0,0 @@
1
- <div class="page-header">
2
- <h1>Editing <%= singular_table_name %></h1>
3
- </div>
4
-
5
- <%%= render 'form' %>
6
-
7
- <%%= link_to 'Show', @<%= singular_table_name %> %> |
8
- <%%= link_to 'Back', <%= index_helper %>_path %>
9
-
@@ -1,13 +0,0 @@
1
- <p id="notice"><%%= notice %></p>
2
-
3
- <% attributes.each do |attribute| -%>
4
- <p>
5
- <b><%= attribute.human_name %>:</b>
6
- <%%= @<%= singular_table_name %>.<%= attribute.name %> %>
7
- </p>
8
-
9
- <% end -%>
10
-
11
- <%%= link_to 'Edit', edit_<%= singular_table_name %>_path(@<%= singular_table_name %>) %> |
12
- <%%= link_to 'Back', <%= index_helper %>_path %>
13
-
@@ -1,3 +0,0 @@
1
- body {
2
- padding-top: 60px;
3
- }