bootstrap_leather 0.9.4 → 0.10.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +1 -0
  3. data/.rubocop.yml +23 -0
  4. data/.rubocop_todo.yml +12 -0
  5. data/.ruby-gemset +1 -1
  6. data/.ruby-version +1 -1
  7. data/.travis.yml +5 -0
  8. data/Gemfile +40 -7
  9. data/LICENSE.txt +1 -1
  10. data/README.md +260 -0
  11. data/Rakefile +35 -20
  12. data/VERSION +1 -1
  13. data/app/helpers/bootstrap_leather/alerts_helper.rb +36 -0
  14. data/app/helpers/bootstrap_leather/application_helper.rb +21 -0
  15. data/app/helpers/bootstrap_leather/badges_helper.rb +21 -0
  16. data/app/helpers/bootstrap_leather/carousels_helper.rb +32 -0
  17. data/app/helpers/bootstrap_leather/foot_helper.rb +14 -0
  18. data/app/helpers/bootstrap_leather/grid_helper.rb +10 -0
  19. data/app/helpers/bootstrap_leather/head_helper.rb +67 -0
  20. data/app/helpers/bootstrap_leather/hero_unit_helper.rb +14 -0
  21. data/app/helpers/bootstrap_leather/icons_helper.rb +33 -0
  22. data/app/helpers/bootstrap_leather/modals_helper.rb +20 -0
  23. data/app/helpers/bootstrap_leather/navigation_helper.rb +71 -0
  24. data/app/helpers/bootstrap_leather/tabs_helper.rb +28 -0
  25. data/app/helpers/bootstrap_leather/thumbnails_helper.rb +13 -0
  26. data/app/helpers/bootstrap_leather/typography_helper.rb +38 -0
  27. data/app/helpers/bootstrap_leather/widgets_helper.rb +29 -0
  28. data/app/views/bootstrap_leather/{_alert.html.haml → alerts/_alert.html.haml} +1 -1
  29. data/app/views/bootstrap_leather/{_alert_flash_messages.html.haml → alerts/_alert_flash_messages.html.haml} +0 -0
  30. data/app/views/bootstrap_leather/{_badge.html.haml → badges/_badge.html.haml} +1 -1
  31. data/app/views/bootstrap_leather/badges/_badge_to.html.haml +3 -0
  32. data/app/views/bootstrap_leather/{_carousel.html.haml → carousels/_carousel.html.haml} +0 -0
  33. data/app/views/bootstrap_leather/{_carousel_with_thumbnails.html.haml → carousels/_carousel_with_thumbnails.html.haml} +0 -0
  34. data/app/views/bootstrap_leather/{_footer_javascript.html.haml → foot/_footer_javascript.html.haml} +0 -0
  35. data/app/views/bootstrap_leather/{_head_css.html.haml → head/_head_css.html.haml} +0 -0
  36. data/app/views/bootstrap_leather/{_hero_unit.html.haml → hero_unit/_hero_unit.html.haml} +0 -0
  37. data/app/views/bootstrap_leather/{_icon.html.haml → icons/_icon.html.haml} +0 -0
  38. data/app/views/bootstrap_leather/{_icon_button_to.html.haml → icons/_icon_button_to.html.haml} +0 -0
  39. data/app/views/bootstrap_leather/{_icon_link_to.html.haml → icons/_icon_link_to.html.haml} +0 -0
  40. data/app/views/bootstrap_leather/{_modal.html.haml → modals/_modal.html.haml} +2 -2
  41. data/app/views/bootstrap_leather/navigation/_dropdown_nav_item.html.haml +6 -0
  42. data/app/views/bootstrap_leather/navigation/_hamburger_menu.html.haml +6 -0
  43. data/app/views/bootstrap_leather/{_logo_and_title.html.haml → navigation/_logo_and_title.html.haml} +0 -0
  44. data/app/views/bootstrap_leather/{_nav_heading.html.haml → navigation/_nav_heading.html.haml} +0 -0
  45. data/app/views/bootstrap_leather/{_nav_item.html.haml → navigation/_nav_item.html.haml} +0 -0
  46. data/app/views/bootstrap_leather/{_nav_list.html.haml → navigation/_nav_list.html.haml} +0 -0
  47. data/app/views/bootstrap_leather/navigation/_navbar.html.haml +14 -0
  48. data/app/views/bootstrap_leather/navigation/_navbar_contents.html.haml +5 -0
  49. data/app/views/bootstrap_leather/tabs/_tabs.html.haml +10 -0
  50. data/app/views/bootstrap_leather/{_thumbnail.html.haml → thumbnails/_thumbnail.html.haml} +0 -0
  51. data/app/views/bootstrap_leather/{_definition_list.html.haml → typography/_dl.html.haml} +0 -0
  52. data/app/views/bootstrap_leather/{_page_header.html.haml → typography/_page_header.html.haml} +1 -1
  53. data/app/views/bootstrap_leather/widgets/_widgets.html.haml +10 -0
  54. data/bin/rails +15 -0
  55. data/bootstrap_leather.gemspec +219 -57
  56. data/config/locales/en.yml +9 -0
  57. data/lib/bootstrap_leather/configuration.rb +16 -12
  58. data/lib/bootstrap_leather/engine.rb +19 -4
  59. data/lib/bootstrap_leather/localization.rb +20 -18
  60. data/lib/bootstrap_leather/version.rb +4 -1
  61. data/lib/bootstrap_leather.rb +6 -2
  62. data/lib/generators/bootstrap_leather/install/install_generator.rb +21 -19
  63. data/lib/generators/bootstrap_leather/install/templates/initializer.rb +3 -1
  64. data/lib/generators/bootstrap_leather/utils.rb +13 -4
  65. data/lib/templates/erb/scaffold/_form.html.erb +11 -0
  66. data/lib/templates/erb/scaffold/edit.html.erb +9 -0
  67. data/lib/templates/erb/scaffold/index.html.erb +29 -0
  68. data/lib/templates/erb/scaffold/new.html.erb +7 -0
  69. data/lib/templates/erb/scaffold/show.html.erb +12 -0
  70. data/lib/templates/haml/scaffold/_form.html.haml +10 -0
  71. data/lib/templates/haml/scaffold/edit.html.haml +8 -0
  72. data/lib/templates/haml/scaffold/index.html.haml +21 -0
  73. data/lib/templates/haml/scaffold/new.html.haml +6 -0
  74. data/lib/templates/haml/scaffold/show.html.haml +10 -0
  75. data/spec/dummy/Rakefile +9 -0
  76. data/spec/dummy/app/assets/images/.keep +0 -0
  77. data/spec/dummy/app/assets/javascripts/application.js +16 -0
  78. data/spec/dummy/app/assets/stylesheets/application.scss +19 -0
  79. data/spec/dummy/app/assets/stylesheets/bootstrap-everything.scss +54 -0
  80. data/spec/dummy/app/controllers/application_controller.rb +6 -0
  81. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  82. data/spec/dummy/app/controllers/doo_dads_controller.rb +58 -0
  83. data/spec/dummy/app/controllers/erbits_controller.rb +58 -0
  84. data/spec/dummy/app/controllers/whatzits_controller.rb +58 -0
  85. data/spec/dummy/app/helpers/application_helper.rb +4 -0
  86. data/spec/dummy/app/mailers/application_mailer.rb +6 -0
  87. data/spec/dummy/app/models/application_record.rb +5 -0
  88. data/spec/dummy/app/models/concerns/.keep +0 -0
  89. data/spec/dummy/app/models/doo_dad.rb +3 -0
  90. data/spec/dummy/app/models/erbit.rb +2 -0
  91. data/spec/dummy/app/models/whatzit.rb +2 -0
  92. data/spec/dummy/app/views/doo_dads/_form.html.haml +16 -0
  93. data/spec/dummy/app/views/doo_dads/edit.html.haml +7 -0
  94. data/spec/dummy/app/views/doo_dads/index.html.haml +23 -0
  95. data/spec/dummy/app/views/doo_dads/new.html.haml +5 -0
  96. data/spec/dummy/app/views/doo_dads/show.html.haml +12 -0
  97. data/spec/dummy/app/views/erbits/_form.html.erb +5 -0
  98. data/spec/dummy/app/views/erbits/edit.html.erb +9 -0
  99. data/spec/dummy/app/views/erbits/index.html.erb +27 -0
  100. data/spec/dummy/app/views/erbits/new.html.erb +7 -0
  101. data/spec/dummy/app/views/erbits/show.html.erb +12 -0
  102. data/spec/dummy/app/views/layouts/application.html.haml +22 -0
  103. data/spec/dummy/app/views/pages/index.html.haml +1 -0
  104. data/spec/dummy/app/views/pages/style_guide.html.haml +801 -0
  105. data/spec/dummy/app/views/whatzits/_form.html.haml +4 -0
  106. data/spec/dummy/app/views/whatzits/edit.html.haml +8 -0
  107. data/spec/dummy/app/views/whatzits/index.html.haml +19 -0
  108. data/spec/dummy/app/views/whatzits/new.html.haml +6 -0
  109. data/spec/dummy/app/views/whatzits/show.html.haml +10 -0
  110. data/spec/dummy/bin/bundle +5 -0
  111. data/spec/dummy/bin/rails +6 -0
  112. data/spec/dummy/bin/rake +6 -0
  113. data/spec/dummy/bin/setup +36 -0
  114. data/spec/dummy/bin/update +31 -0
  115. data/spec/dummy/config/application.rb +36 -0
  116. data/spec/dummy/config/boot.rb +7 -0
  117. data/spec/dummy/config/cable.yml +9 -0
  118. data/spec/dummy/config/database.yml +25 -0
  119. data/spec/dummy/config/environment.rb +7 -0
  120. data/spec/dummy/config/environments/development.rb +57 -0
  121. data/spec/dummy/config/environments/test.rb +45 -0
  122. data/spec/dummy/config/initializers/application_controller_renderer.rb +7 -0
  123. data/spec/dummy/config/initializers/assets.rb +14 -0
  124. data/spec/dummy/config/initializers/backtrace_silencers.rb +10 -0
  125. data/spec/dummy/config/initializers/bootstrap_leather.rb +9 -0
  126. data/spec/dummy/config/initializers/cookies_serializer.rb +7 -0
  127. data/spec/dummy/config/initializers/filter_parameter_logging.rb +6 -0
  128. data/spec/dummy/config/initializers/high_voltage.rb +5 -0
  129. data/spec/dummy/config/initializers/inflections.rb +17 -0
  130. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  131. data/spec/dummy/config/initializers/new_framework_defaults.rb +29 -0
  132. data/spec/dummy/config/initializers/session_store.rb +5 -0
  133. data/spec/dummy/config/initializers/wrap_parameters.rb +17 -0
  134. data/spec/dummy/config/locales/en.yml +23 -0
  135. data/spec/dummy/config/puma.rb +49 -0
  136. data/spec/dummy/config/routes.rb +8 -0
  137. data/spec/dummy/config/secrets.yml +22 -0
  138. data/spec/dummy/config/spring.rb +8 -0
  139. data/spec/dummy/config.ru +7 -0
  140. data/spec/dummy/db/migrate/20170407151055_create_doo_dads.rb +10 -0
  141. data/spec/dummy/db/migrate/20170408145839_create_whatzits.rb +10 -0
  142. data/spec/dummy/db/migrate/20170408161201_create_erbits.rb +10 -0
  143. data/spec/dummy/db/schema.rb +36 -0
  144. data/spec/dummy/db/seeds.rb +7 -0
  145. data/spec/dummy/db/test.sqlite3 +0 -0
  146. data/spec/factories/doo_dad.rb +6 -0
  147. data/spec/factories/erbit.rb +6 -0
  148. data/spec/factories/whatzit.rb +6 -0
  149. data/spec/helpers/bootstrap_leather/alerts_helper_spec.rb +62 -0
  150. data/spec/helpers/bootstrap_leather/badges_helper_spec.rb +41 -0
  151. data/spec/helpers/bootstrap_leather/carousels_helper_spec.rb +44 -0
  152. data/spec/helpers/bootstrap_leather/foot_helper_spec.rb +20 -0
  153. data/spec/helpers/bootstrap_leather/grid_helper_spec.rb +10 -0
  154. data/spec/helpers/bootstrap_leather/head_helper_spec.rb +82 -0
  155. data/spec/helpers/bootstrap_leather/hero_unit_helper_spec.rb +20 -0
  156. data/spec/helpers/bootstrap_leather/icon_helper_spec.rb +48 -0
  157. data/spec/helpers/bootstrap_leather/modals_helper_spec.rb +22 -0
  158. data/spec/helpers/bootstrap_leather/navigation_helper_spec.rb +110 -0
  159. data/spec/helpers/bootstrap_leather/tabs_helper_spec.rb +39 -0
  160. data/spec/helpers/bootstrap_leather/thumbnails_helper_spec.rb +20 -0
  161. data/spec/helpers/bootstrap_leather/typography_helper_spec.rb +43 -0
  162. data/spec/helpers/bootstrap_leather/widgets_helper_spec.rb +22 -0
  163. data/spec/rails_helper.rb +88 -0
  164. data/spec/spec_helper.rb +102 -0
  165. metadata +360 -44
  166. data/.document +0 -5
  167. data/README.rdoc +0 -194
  168. data/app/helpers/bootstrap_leather_helper.rb +0 -232
  169. data/app/views/bootstrap_leather/_badge_to.html.haml +0 -4
  170. data/app/views/bootstrap_leather/_dropdown_nav_item.html.haml +0 -11
  171. data/app/views/bootstrap_leather/_navbar.html.haml +0 -39
  172. data/app/views/bootstrap_leather/_tabs.html.haml +0 -10
  173. data/app/views/bootstrap_leather/_widgets.html.haml +0 -9
  174. data/lib/bootstrap_leather/railtie.rb +0 -9
@@ -0,0 +1,10 @@
1
+ = bootstrap_form_for(<%= singular_table_name %>) do |f|
2
+ <% attributes.each do |attribute| -%>
3
+ <% if attribute.password_digest? -%>
4
+ = f.password_field :password
5
+ = f.password_field :password_confirmation
6
+ <% else -%>
7
+ = f.<%= attribute.field_type %> :<%= attribute.column_name %>
8
+ <% end -%>
9
+ <% end -%>
10
+ = f.submit
@@ -0,0 +1,8 @@
1
+ - add_title :editing.l(name: '<%= singular_table_name.titleize %>')
2
+
3
+ = render 'form', <%= singular_table_name %>: @<%= singular_table_name %>
4
+
5
+ %p
6
+ = link_to :show.l, @<%= singular_table_name %>
7
+ |
8
+ = link_to :back.l, <%= index_helper %>_path
@@ -0,0 +1,21 @@
1
+ - add_title '<%= plural_table_name.titleize %>'
2
+
3
+ %table.table.table-bordered
4
+ %thead
5
+ %tr
6
+ <% attributes.reject(&:password_digest?).each do |attribute| -%>
7
+ %th <%= attribute.human_name %>
8
+ <% end -%>
9
+ %th{colspan: '3'}
10
+ %tbody
11
+ - @<%= plural_table_name %>.each do |<%= singular_table_name %>|
12
+ %tr
13
+ <% attributes.reject(&:password_digest?).each do |attribute| -%>
14
+ %td= <%= singular_table_name %>.<%= attribute.name %>
15
+ <% end -%>
16
+ %td= link_to :show.l, <%= singular_table_name %>, class: 'btn btn-success'
17
+ %td= link_to :edit.l, edit_<%= singular_table_name %>_path(<%= singular_table_name %>), class: 'btn btn-info'
18
+ %td= link_to :destroy.l, <%= singular_table_name %>, method: :delete, data: { confirm: :are_you_sure.l }, class: 'btn btn-danger'
19
+
20
+ %p
21
+ = link_to :new.l(name: '<%= singular_table_name.titleize %>'), new_<%= singular_table_name %>_path, class: 'btn btn-primary'
@@ -0,0 +1,6 @@
1
+ - add_title :new.l(name: '<%= singular_table_name.titleize %>')
2
+
3
+ = render 'form', <%= singular_table_name %>: @<%= singular_table_name %>
4
+
5
+ %p
6
+ = link_to :back.l, <%= index_helper %>_path
@@ -0,0 +1,10 @@
1
+ - add_title :showing.l(name: '<%= singular_table_name.titleize %>')
2
+ %dl
3
+ <% attributes.reject(&:password_digest?).each do |attribute| -%>
4
+ %dt <%= attribute.human_name %>:</dt>
5
+ %dd= @<%= singular_table_name %>.<%= attribute.name %>
6
+ <% end -%>
7
+ %p
8
+ = link_to :edit.l, edit_<%= singular_table_name %>_path(@<%= singular_table_name %>)
9
+ |
10
+ = link_to :back.l, <%= index_helper %>_path
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
4
+ # for example lib/tasks/capistrano.rake, and they will automatically be
5
+ # available to Rake.
6
+
7
+ require_relative 'config/application'
8
+
9
+ Rails.application.load_tasks
File without changes
@@ -0,0 +1,16 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require bootstrap-sprockets
16
+ //= require_tree .
@@ -0,0 +1,19 @@
1
+ // 'bootstrap-sprockets' must be imported before 'bootstrap' and 'bootstrap/variables'
2
+ @import 'bootstrap-sprockets';
3
+ @import 'bootstrap-everything';
4
+ @import 'bootstrap/theme';
5
+
6
+ .navbar-header {
7
+ overflow: hidden;
8
+ }
9
+
10
+ .navbar-brand {
11
+ display: block;
12
+ width: 300px;
13
+ }
14
+
15
+ .logo {
16
+ float: left;
17
+ height: 2em;
18
+ margin: -.5em 1em -.5em 0;
19
+ }
@@ -0,0 +1,54 @@
1
+ /*!
2
+ * This file exists to fix a naming conflict.
3
+ */
4
+
5
+ // Core variables and mixins
6
+ @import 'bootstrap/variables';
7
+ @import 'bootstrap/mixins';
8
+
9
+ // Reset and dependencies
10
+ @import 'bootstrap/normalize';
11
+ @import 'bootstrap/print';
12
+ @import 'bootstrap/glyphicons';
13
+
14
+ // Core CSS
15
+ @import 'bootstrap/scaffolding';
16
+ @import 'bootstrap/type';
17
+ @import 'bootstrap/code';
18
+ @import 'bootstrap/grid';
19
+ @import 'bootstrap/tables';
20
+ @import 'bootstrap/forms';
21
+ @import 'bootstrap/buttons';
22
+
23
+ // Components
24
+ @import 'bootstrap/component-animations';
25
+ @import 'bootstrap/dropdowns';
26
+ @import 'bootstrap/button-groups';
27
+ @import 'bootstrap/input-groups';
28
+ @import 'bootstrap/navs';
29
+ @import 'bootstrap/navbar';
30
+ @import 'bootstrap/breadcrumbs';
31
+ @import 'bootstrap/pagination';
32
+ @import 'bootstrap/pager';
33
+ @import 'bootstrap/labels';
34
+ @import 'bootstrap/badges';
35
+ @import 'bootstrap/jumbotron';
36
+ @import 'bootstrap/thumbnails';
37
+ @import 'bootstrap/alerts';
38
+ @import 'bootstrap/progress-bars';
39
+ @import 'bootstrap/media';
40
+ @import 'bootstrap/list-group';
41
+ @import 'bootstrap/panels';
42
+ @import 'bootstrap/responsive-embed';
43
+ @import 'bootstrap/wells';
44
+ @import 'bootstrap/close';
45
+
46
+ // Components w/ JavaScript
47
+ @import 'bootstrap/modals';
48
+ @import 'bootstrap/tooltip';
49
+ @import 'bootstrap/popovers';
50
+ @import 'bootstrap/carousel';
51
+
52
+ // Utility classes
53
+ @import 'bootstrap/utilities';
54
+ @import 'bootstrap/responsive-utilities';
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ApplicationController < ActionController::Base
4
+ protect_from_forgery with: :exception
5
+ helper BootstrapLeather::ApplicationHelper
6
+ end
File without changes
@@ -0,0 +1,58 @@
1
+ class DooDadsController < ApplicationController
2
+ before_action :set_doo_dad, only: [:show, :edit, :update, :destroy]
3
+
4
+ # GET /doo_dads
5
+ def index
6
+ @doo_dads = DooDad.all
7
+ end
8
+
9
+ # GET /doo_dads/1
10
+ def show
11
+ end
12
+
13
+ # GET /doo_dads/new
14
+ def new
15
+ @doo_dad = DooDad.new
16
+ end
17
+
18
+ # GET /doo_dads/1/edit
19
+ def edit
20
+ end
21
+
22
+ # POST /doo_dads
23
+ def create
24
+ @doo_dad = DooDad.new(doo_dad_params)
25
+
26
+ if @doo_dad.save
27
+ redirect_to @doo_dad, notice: 'Doo dad was successfully created.'
28
+ else
29
+ render :new
30
+ end
31
+ end
32
+
33
+ # PATCH/PUT /doo_dads/1
34
+ def update
35
+ if @doo_dad.update(doo_dad_params)
36
+ redirect_to @doo_dad, notice: 'Doo dad was successfully updated.'
37
+ else
38
+ render :edit
39
+ end
40
+ end
41
+
42
+ # DELETE /doo_dads/1
43
+ def destroy
44
+ @doo_dad.destroy
45
+ redirect_to doo_dads_url, notice: 'Doo dad was successfully destroyed.'
46
+ end
47
+
48
+ private
49
+ # Use callbacks to share common setup or constraints between actions.
50
+ def set_doo_dad
51
+ @doo_dad = DooDad.find(params[:id])
52
+ end
53
+
54
+ # Only allow a trusted parameter "white list" through.
55
+ def doo_dad_params
56
+ params.require(:doo_dad).permit(:name, :body)
57
+ end
58
+ end
@@ -0,0 +1,58 @@
1
+ class ErbitsController < ApplicationController
2
+ before_action :set_erbit, only: [:show, :edit, :update, :destroy]
3
+
4
+ # GET /erbits
5
+ def index
6
+ @erbits = Erbit.all
7
+ end
8
+
9
+ # GET /erbits/1
10
+ def show
11
+ end
12
+
13
+ # GET /erbits/new
14
+ def new
15
+ @erbit = Erbit.new
16
+ end
17
+
18
+ # GET /erbits/1/edit
19
+ def edit
20
+ end
21
+
22
+ # POST /erbits
23
+ def create
24
+ @erbit = Erbit.new(erbit_params)
25
+
26
+ if @erbit.save
27
+ redirect_to @erbit, notice: 'Erbit was successfully created.'
28
+ else
29
+ render :new
30
+ end
31
+ end
32
+
33
+ # PATCH/PUT /erbits/1
34
+ def update
35
+ if @erbit.update(erbit_params)
36
+ redirect_to @erbit, notice: 'Erbit was successfully updated.'
37
+ else
38
+ render :edit
39
+ end
40
+ end
41
+
42
+ # DELETE /erbits/1
43
+ def destroy
44
+ @erbit.destroy
45
+ redirect_to erbits_url, notice: 'Erbit was successfully destroyed.'
46
+ end
47
+
48
+ private
49
+ # Use callbacks to share common setup or constraints between actions.
50
+ def set_erbit
51
+ @erbit = Erbit.find(params[:id])
52
+ end
53
+
54
+ # Only allow a trusted parameter "white list" through.
55
+ def erbit_params
56
+ params.require(:erbit).permit(:name, :description)
57
+ end
58
+ end
@@ -0,0 +1,58 @@
1
+ class WhatzitsController < ApplicationController
2
+ before_action :set_whatzit, only: [:show, :edit, :update, :destroy]
3
+
4
+ # GET /whatzits
5
+ def index
6
+ @whatzits = Whatzit.all
7
+ end
8
+
9
+ # GET /whatzits/1
10
+ def show
11
+ end
12
+
13
+ # GET /whatzits/new
14
+ def new
15
+ @whatzit = Whatzit.new
16
+ end
17
+
18
+ # GET /whatzits/1/edit
19
+ def edit
20
+ end
21
+
22
+ # POST /whatzits
23
+ def create
24
+ @whatzit = Whatzit.new(whatzit_params)
25
+
26
+ if @whatzit.save
27
+ redirect_to @whatzit, notice: 'Whatzit was successfully created.'
28
+ else
29
+ render :new
30
+ end
31
+ end
32
+
33
+ # PATCH/PUT /whatzits/1
34
+ def update
35
+ if @whatzit.update(whatzit_params)
36
+ redirect_to @whatzit, notice: 'Whatzit was successfully updated.'
37
+ else
38
+ render :edit
39
+ end
40
+ end
41
+
42
+ # DELETE /whatzits/1
43
+ def destroy
44
+ @whatzit.destroy
45
+ redirect_to whatzits_url, notice: 'Whatzit was successfully destroyed.'
46
+ end
47
+
48
+ private
49
+ # Use callbacks to share common setup or constraints between actions.
50
+ def set_whatzit
51
+ @whatzit = Whatzit.find(params[:id])
52
+ end
53
+
54
+ # Only allow a trusted parameter "white list" through.
55
+ def whatzit_params
56
+ params.require(:whatzit).permit(:name, :description)
57
+ end
58
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ApplicationHelper
4
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ApplicationMailer < ActionMailer::Base
4
+ default from: 'from@example.com'
5
+ layout 'mailer'
6
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ApplicationRecord < ActiveRecord::Base
4
+ self.abstract_class = true
5
+ end
File without changes
@@ -0,0 +1,3 @@
1
+ class DooDad < ApplicationRecord
2
+ validates_presence_of :name
3
+ end
@@ -0,0 +1,2 @@
1
+ class Erbit < ApplicationRecord
2
+ end
@@ -0,0 +1,2 @@
1
+ class Whatzit < ApplicationRecord
2
+ end
@@ -0,0 +1,16 @@
1
+ = form_for @doo_dad do |f|
2
+ - if @doo_dad.errors.any?
3
+ #error_explanation
4
+ %h2= "#{pluralize(@doo_dad.errors.count, "error")} prohibited this doo_dad from being saved:"
5
+ %ul
6
+ - @doo_dad.errors.full_messages.each do |msg|
7
+ %li= msg
8
+
9
+ .field
10
+ = f.label :name
11
+ = f.text_field :name
12
+ .field
13
+ = f.label :body
14
+ = f.text_area :body
15
+ .actions
16
+ = f.submit 'Save'
@@ -0,0 +1,7 @@
1
+ %h1 Editing doo_dad
2
+
3
+ = render 'form'
4
+
5
+ = link_to 'Show', @doo_dad
6
+ \|
7
+ = link_to 'Back', doo_dads_path
@@ -0,0 +1,23 @@
1
+ %h1 Listing doo_dads
2
+
3
+ %table
4
+ %thead
5
+ %tr
6
+ %th Name
7
+ %th Body
8
+ %th
9
+ %th
10
+ %th
11
+
12
+ %tbody
13
+ - @doo_dads.each do |doo_dad|
14
+ %tr
15
+ %td= doo_dad.name
16
+ %td= doo_dad.body
17
+ %td= link_to 'Show', doo_dad
18
+ %td= link_to 'Edit', edit_doo_dad_path(doo_dad)
19
+ %td= link_to 'Destroy', doo_dad, :method => :delete, :data => { :confirm => 'Are you sure?' }
20
+
21
+ %br
22
+
23
+ = link_to 'New Doo dad', new_doo_dad_path
@@ -0,0 +1,5 @@
1
+ %h1 New doo_dad
2
+
3
+ = render 'form'
4
+
5
+ = link_to 'Back', doo_dads_path
@@ -0,0 +1,12 @@
1
+ %p#notice= notice
2
+
3
+ %p
4
+ %b Name:
5
+ = @doo_dad.name
6
+ %p
7
+ %b Body:
8
+ = @doo_dad.body
9
+
10
+ = link_to 'Edit', edit_doo_dad_path(@doo_dad)
11
+ \|
12
+ = link_to 'Back', doo_dads_path
@@ -0,0 +1,5 @@
1
+ <%= bootstrap_form_for(erbit) do |f| %>
2
+ <%= f.text_field :name %>
3
+ <%= f.text_area :description %>
4
+ <%= f.submit %>
5
+ <% end %>
@@ -0,0 +1,9 @@
1
+ <% add_title :editing.l(name: 'Erbit') %>
2
+
3
+ <%= render 'form', erbit: @erbit %>
4
+
5
+ <p>
6
+ <%= link_to :show.l, @erbit %>
7
+ |
8
+ <%= link_to :back.l, erbits_path %>
9
+ </p>
@@ -0,0 +1,27 @@
1
+ <% add_title 'Erbits' %>
2
+
3
+ <table class="table table-bordered">
4
+ <thead>
5
+ <tr>
6
+ <th>Name</th>
7
+ <th>Description</th>
8
+ <th colspan="3"></th>
9
+ </tr>
10
+ </thead>
11
+
12
+ <tbody>
13
+ <% @erbits.each do |erbit| %>
14
+ <tr>
15
+ <td><%= erbit.name %></td>
16
+ <td><%= erbit.description %></td>
17
+ <td><%= link_to :show.l, erbit, class: 'btn btn-success' %></td>
18
+ <td><%= link_to :edit.l, edit_erbit_path(erbit), class: 'btn btn-info' %></td>
19
+ <td><%= link_to :destroy.l, erbit, method: :delete, class: 'btn btn-danger', data: { confirm: :are_you_sure.l } %></td>
20
+ </tr>
21
+ <% end %>
22
+ </tbody>
23
+ </table>
24
+
25
+ <p>
26
+ <%= link_to :new.l(name: 'Erbit'), new_erbit_path, class: 'btn btn-primary' %>
27
+ </p>
@@ -0,0 +1,7 @@
1
+ <% add_title :new.l(name: 'Erbit') %>
2
+
3
+ <%= render 'form', erbit: @erbit %>
4
+
5
+ <p>
6
+ <%= link_to :back.l, erbits_path %>
7
+ </p>
@@ -0,0 +1,12 @@
1
+ <% add_title :showing.l(name: 'Erbit') %>
2
+ <dl>
3
+ <dt>Name:</dt>
4
+ <dd><%= @erbit.name %></dd>
5
+ <dt>Description:</dt>
6
+ <dd><%= @erbit.description %></dd>
7
+ </dl>
8
+ <p>
9
+ <%= link_to :edit.l, edit_erbit_path(@erbit) %>
10
+ |
11
+ <%= link_to :back.l, erbits_path %>
12
+ </p>
@@ -0,0 +1,22 @@
1
+ %head
2
+ = render_title # For the title tag, including SEO content
3
+ = render_keywords # Defaults to what you put in the config file
4
+ = render_description # Can be hooked up within a mountable rails engine, too.
5
+ = responsive_meta_tag # If you're using the responsive features, you need this in your head
6
+
7
+ = stylesheet_link_tag 'application'
8
+
9
+ = render_head_css
10
+ = javascript_include_tag 'application'
11
+ = csrf_meta_tags
12
+
13
+ %body
14
+ .container
15
+ = render_hero_unit
16
+ .content
17
+ = render_page_header # For the h1 tag containing the title alone
18
+ #alert_area
19
+ = alert_flash_messages
20
+ = yield
21
+ %footer
22
+ = render_footer_javascript
@@ -0,0 +1 @@
1
+ - add_title 'Hello World'