beautiful_scaffold 0.3.0.rc5 → 0.3.0.rc6
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +10 -0
- data/beautiful_scaffold.gemspec +1 -1
- data/lib/generators/beautiful_jointable_generator.rb +2 -5
- data/lib/generators/beautiful_scaffold_common_methods.rb +1 -1
- data/lib/generators/templates/app/assets/javascripts/application-bs.js +1 -0
- data/lib/generators/templates/app/views/index.html.erb +3 -3
- metadata +1 -1
data/CHANGELOG
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
== 0.3.0.rc6
|
2
|
+
|
3
|
+
* enhancement
|
4
|
+
* Add title for show, edit, destroy icon
|
5
|
+
|
6
|
+
* bugfix
|
7
|
+
* require jquery-barcode to application-bs.js
|
8
|
+
* avoid to display log of require
|
9
|
+
* jointable def up def down -> def change (migration)
|
10
|
+
|
1
11
|
== 0.3.0.rc5
|
2
12
|
|
3
13
|
* bugfix
|
data/beautiful_scaffold.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "beautiful_scaffold"
|
6
|
-
s.version = "0.3.0.
|
6
|
+
s.version = "0.3.0.rc6"
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.summary = "Beautiful Scaffold generate fully customizable scaffold"
|
9
9
|
s.email = "claudel.sylvain@gmail.com"
|
@@ -14,7 +14,7 @@ class BeautifulJointableGenerator < Rails::Generators::Base
|
|
14
14
|
sorted_model = join_models.sort
|
15
15
|
|
16
16
|
# Generate migration
|
17
|
-
|
17
|
+
migration_content = "
|
18
18
|
create_table :#{sorted_model[0].pluralize}_#{sorted_model[1].pluralize}, :id => false do |t|
|
19
19
|
t.integer :#{sorted_model[0]}_id
|
20
20
|
t.integer :#{sorted_model[1]}_id
|
@@ -23,15 +23,12 @@ class BeautifulJointableGenerator < Rails::Generators::Base
|
|
23
23
|
add_index :#{sorted_model[0].pluralize}_#{sorted_model[1].pluralize}, [:#{sorted_model[0]}_id, :#{sorted_model[1]}_id]
|
24
24
|
"
|
25
25
|
|
26
|
-
migration_content_down = "\n drop_table :#{sorted_model[0].pluralize}_#{sorted_model[1].pluralize} "
|
27
|
-
|
28
26
|
migration_name = "create_join_table_for_#{sorted_model[0]}_and_#{sorted_model[1]}"
|
29
27
|
generate("migration", migration_name)
|
30
28
|
|
31
29
|
filename = Dir.glob("db/migrate/*#{migration_name}.rb")[0]
|
32
30
|
|
33
|
-
inject_into_file(filename,
|
34
|
-
inject_into_file(filename, migration_content_down, :after => "def down")
|
31
|
+
inject_into_file(filename, migration_content, :after => "def change")
|
35
32
|
|
36
33
|
# Add habtm relation
|
37
34
|
inject_into_file("app/models/#{sorted_model[0]}.rb", "\n has_and_belongs_to_many :#{sorted_model[1].pluralize}", :after => "ActiveRecord::Base")
|
@@ -96,7 +96,7 @@ module BeautifulScaffoldCommonMethods
|
|
96
96
|
|
97
97
|
def attributes
|
98
98
|
# https://raw.github.com/rails/rails/master/railties/lib/rails/generators/generated_attribute.rb
|
99
|
-
|
99
|
+
require 'rails/generators/generated_attribute'
|
100
100
|
return myattributes.map{ |a|
|
101
101
|
attr, type = a.split(":")
|
102
102
|
Rails::Generators::GeneratedAttribute.new(attr, type.to_sym)
|
@@ -75,9 +75,9 @@
|
|
75
75
|
<td <%%= visible_column("<%= singular_table_name %>", "updated_at") %> class="col-updated_at <%%= align_attribute("datetime") %>">
|
76
76
|
<%%= l(<%= singular_table_name %>.updated_at, :format => :long) %>
|
77
77
|
</td>
|
78
|
-
<td><%%= link_to '<i class="icon-search"></i>'.html_safe, <%= namespace_for_route %><%= singular_table_name %>_path(<%= singular_table_name %>) %></td>
|
79
|
-
<td><%%= link_to '<i class="icon-pencil"></i>'.html_safe, edit_<%= namespace_for_route %><%= singular_table_name %>_path(<%= singular_table_name %>) %></td>
|
80
|
-
<td><%%= link_to '<i class="icon-remove"></i>'.html_safe, <%= namespace_for_route %><%= singular_table_name %>_path(<%= singular_table_name %>), :confirm => t(:are_you_sure, :default => "Are you sure?"), :method => :delete %></td>
|
78
|
+
<td><%%= link_to '<i class="icon-search"></i>'.html_safe, <%= namespace_for_route %><%= singular_table_name %>_path(<%= singular_table_name %>), :title => t(:show, :default => "Show") %></td>
|
79
|
+
<td><%%= link_to '<i class="icon-pencil"></i>'.html_safe, edit_<%= namespace_for_route %><%= singular_table_name %>_path(<%= singular_table_name %>), :title => t(:edit, :default => "Edit") %></td>
|
80
|
+
<td><%%= link_to '<i class="icon-remove"></i>'.html_safe, <%= namespace_for_route %><%= singular_table_name %>_path(<%= singular_table_name %>), :confirm => t(:are_you_sure, :default => "Are you sure?"), :method => :delete, :title => t(:destroy, :default => "Destroy") %></td>
|
81
81
|
</tr>
|
82
82
|
<%% end %>
|
83
83
|
</tbody>
|