Skip to content

Commit f5ab454

Browse files
Get rid of bootstrap-sass dependency and some empty assets
We don't need bootstrap to make the test forms/demo pretty for people to look at, we can improve that without bootstrap in case we want to (which is not something I'm doing in the near future anyway).
1 parent b7603c0 commit f5ab454

19 files changed

+40
-518
lines changed

Gemfile

-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ gemspec
44

55
gem 'jquery-rails'
66
gem 'simple_form'
7-
gem 'bootstrap-sass'

Gemfile.lock

-4
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ GEM
3434
thread_safe (~> 0.1)
3535
tzinfo (~> 1.1)
3636
arel (5.0.1.20140414130214)
37-
bootstrap-sass (3.2.0.1)
38-
sass (~> 3.2)
3937
builder (3.2.2)
4038
erubis (2.7.0)
4139
hike (1.2.3)
@@ -68,7 +66,6 @@ GEM
6866
rake (>= 0.8.7)
6967
thor (>= 0.18.1, < 2.0)
7068
rake (10.3.2)
71-
sass (3.4.0)
7269
simple_form (3.0.2)
7370
actionpack (~> 4.0)
7471
activemodel (~> 4.0)
@@ -93,7 +90,6 @@ PLATFORMS
9390

9491
DEPENDENCIES
9592
active_form!
96-
bootstrap-sass
9793
jquery-rails
9894
rake (~> 10.3.2)
9995
simple_form

test/dummy/app/assets/javascripts/assignments.js

-2
This file was deleted.

test/dummy/app/assets/javascripts/conferences.js

-2
This file was deleted.

test/dummy/app/assets/javascripts/songs.js

-2
This file was deleted.

test/dummy/app/assets/javascripts/surveys.js

-2
This file was deleted.

test/dummy/app/assets/javascripts/users.js

-2
This file was deleted.

test/dummy/app/assets/stylesheets/application.css

+5
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@
1313
*= require_tree .
1414
*= require_self
1515
*/
16+
17+
body {
18+
margin: 0 auto;
19+
width: 80%;
20+
}

test/dummy/app/assets/stylesheets/assignments.css

-4
This file was deleted.

test/dummy/app/assets/stylesheets/bootstrap.min.css

-330
This file was deleted.

test/dummy/app/assets/stylesheets/conferences.css

-4
This file was deleted.

test/dummy/app/assets/stylesheets/projects.css

-45
This file was deleted.

test/dummy/app/assets/stylesheets/scaffold.css

Whitespace-only changes.

test/dummy/app/assets/stylesheets/songs.css

-4
This file was deleted.

test/dummy/app/assets/stylesheets/surveys.css

-4
This file was deleted.

test/dummy/app/assets/stylesheets/users.css

-4
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,16 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>Cocoon Nested Form Demo (using Simple Form)</title>
5-
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6-
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
4+
<title>Active Form Demo (using Simple Form)</title>
5+
<%= stylesheet_link_tag 'application', media: 'all' %>
6+
<%= javascript_include_tag 'application' %>
77
<%= csrf_meta_tags %>
8-
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
98
</head>
10-
<body style='padding-top:40px;'>
11-
<div class="topbar">
12-
<div class="topbar-inner">
13-
<div class="container">
14-
<h3><%= link_to "Nested Form Demo", "#" %></h3>
15-
<ul>
16-
<li><%= link_to "Home", "#" %></li>
17-
<li><%= link_to "About", "#" %></li>
18-
</ul>
19-
</div>
20-
</div>
21-
</div>
9+
<body>
10+
<h1><%= link_to 'Active Form Demo', '#' %></h1>
2211

2312
<div class="container">
2413
<%= yield %>
2514
</div>
26-
2715
</body>
28-
</html>
16+
</html>
+29-45
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,43 @@
11
<%= simple_form_for @project_form, wrapper: 'inline' do |f| %>
22
<%= f.input :name, :hint => 'The title of your project' %>
33

4-
<ul class="nav nav-tabs tabs">
5-
<li class="active">
6-
<a href="#tasks" role="tab" data-toggle="tab">Tasks (:has_many --nested)</a>
7-
</li>
8-
9-
<li>
10-
<a href="#people" role="tab" data-toggle="tab">People (:has_many)</a>
11-
</li>
12-
13-
<li>
14-
<a href="#owner" role="tab" data-toggle="tab">Owner (:belongs_to)</a>
15-
</li>
16-
17-
<li>
18-
<a href="#tags" role="tab" data-toggle="tab">Tags (:has_many :through)</a>
19-
</li>
20-
</ul>
21-
22-
<div class="tab-content">
23-
<div id="tasks" class="active">
24-
<%= f.simple_fields_for :tasks, wrapper: 'inline' do |task| %>
25-
<%= render 'task_fields', :f => task %>
26-
<% end %>
27-
<div class="links">
28-
<%= link_to_add_association 'add task', f, :tasks, :render_options => { :wrapper => 'inline' } %>
29-
</div>
4+
<h3>Tasks (:has_many --nested)</h3>
5+
<div id="tasks">
6+
<%= f.simple_fields_for :tasks, wrapper: 'inline' do |task| %>
7+
<%= render 'task_fields', :f => task %>
8+
<% end %>
9+
<div class="links">
10+
<%= link_to_add_association 'add task', f, :tasks, :render_options => { :wrapper => 'inline' } %>
3011
</div>
12+
</div>
3113

32-
<div id="people">
33-
<%= f.simple_fields_for :contributors, wrapper: 'inline' do |contributor| %>
34-
<%= render 'contributor_fields', :f => contributor %>
35-
<% end %>
36-
<div class="links">
37-
<%= link_to_add_association 'add contributor', f, :contributors, :render_options => { :wrapper => 'inline' } %>
38-
</div>
14+
<h3>People (:has_many)</h3>
15+
<div id="people">
16+
<%= f.simple_fields_for :contributors, wrapper: 'inline' do |contributor| %>
17+
<%= render 'contributor_fields', :f => contributor %>
18+
<% end %>
19+
<div class="links">
20+
<%= link_to_add_association 'add contributor', f, :contributors, :render_options => { :wrapper => 'inline' } %>
3921
</div>
22+
</div>
4023

41-
<div id="owner">
42-
<div id="owner_from_list">
43-
<%= f.association :owner, :collection => Person.order(:name), :prompt => 'Choose an existing owner' %>
44-
</div>
45-
<%= link_to_add_association 'add a new person as owner', f, :owner, :render_options => { :wrapper => 'inline' } %>
24+
<h3>Owner (:belongs_to)</h3>
25+
<div id="owner">
26+
<div id="owner_from_list">
27+
<%= f.association :owner, :collection => Person.order(:name), :prompt => 'Choose an existing owner' %>
4628
</div>
29+
<%= link_to_add_association 'add a new person as owner', f, :owner, :render_options => { :wrapper => 'inline' } %>
30+
</div>
4731

48-
<div id="tags">
49-
<%= f.simple_fields_for :project_tags, wrapper: 'inline' do |project_tag| %>
50-
<%= render 'project_tag_fields', :f => project_tag %>
51-
<% end %>
52-
<%= link_to_add_association 'add a tag', f, :project_tags, :render_options => { :wrapper => 'inline' } %>
53-
</div>
32+
<h3>Tags (:has_many :through)</h3>
33+
<div id="tags">
34+
<%= f.simple_fields_for :project_tags, wrapper: 'inline' do |project_tag| %>
35+
<%= render 'project_tag_fields', :f => project_tag %>
36+
<% end %>
37+
<%= link_to_add_association 'add a tag', f, :project_tags, :render_options => { :wrapper => 'inline' } %>
5438
</div>
5539

5640
<div class="actions">
5741
<%= f.button :submit, :disable_with => 'Please wait ...' %>
5842
</div>
59-
<% end %>
43+
<% end %>

test/dummy/config/initializers/simple_form_bootstrap.rb

-45
This file was deleted.

0 commit comments

Comments
 (0)