foldscaf 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +6 -0
- data/lib/generators/fold/fold_generator.rb +0 -1
- data/lib/generators/fold/templates/controller.erb +1 -3
- data/lib/generators/fold/templates/migration.erb +4 -1
- data/lib/generators/fold/templates/model.erb +3 -5
- data/lib/generators/fold/templates/views/nombre.erb +1 -1
- data/lib/version.rb +1 -1
- metadata +3 -3
- data/lib/generators/fold/templates/helper.erb +0 -3
data/CHANGELOG.md
ADDED
@@ -41,7 +41,6 @@ class FoldGenerator < Rails::Generators::Base
|
|
41
41
|
template 'model.erb' , "app/models/#{@singular}.rb"
|
42
42
|
template 'migration.erb' , "db/migrate/#{fecha}_create_#{@plural}.rb"
|
43
43
|
template 'controller.erb', "app/controllers/admin/#{@plural}_controller.rb"
|
44
|
-
template 'helper.erb', "app/helpers/#{@plural}_helper.rb"
|
45
44
|
|
46
45
|
%w[_form _mini_form edit index new].each do |action|
|
47
46
|
template "views/#{action}.erb", "app/views/admin/#{@plural}/#{action}.html.erb"
|
@@ -4,11 +4,10 @@ class <%= @class %> < ActiveRecord::Base
|
|
4
4
|
extend FriendlyId
|
5
5
|
friendly_id :<%= @identificador %>, use: :slugged
|
6
6
|
<%- end -%>
|
7
|
-
|
8
7
|
<%- atributos_con_referencia.each do |a| -%>
|
9
8
|
belongs_to :<%= a.nombre %>
|
10
9
|
<%- end -%>
|
11
|
-
|
10
|
+
|
12
11
|
default_scope where(:es_activo => true)<%= ".order('#{@plural}.orden')" if @con_orden %>
|
13
12
|
|
14
13
|
def eliminar!
|
@@ -16,11 +15,10 @@ class <%= @class %> < ActiveRecord::Base
|
|
16
15
|
end
|
17
16
|
|
18
17
|
alias_attribute :to_s, :<%= @identificador %>
|
19
|
-
|
20
|
-
private
|
21
18
|
<%- if @con_orden -%>
|
19
|
+
private
|
22
20
|
def set_orden
|
23
21
|
self.orden = self.id
|
24
22
|
end
|
25
23
|
<%- end -%>
|
26
|
-
end
|
24
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%%- clase ||= 'elemento' -%>
|
2
2
|
<%%= content_tag :tr, :class => clase, :id => "elementos_#{<%= @singular %>.id}" do %>
|
3
3
|
<td><%%= <%= @singular %>.<%= @identificador %> %></td>
|
4
|
-
<td>
|
4
|
+
<td style="text-align:right">
|
5
5
|
<%= "<%= content_tag :i, '',:class => 'handle icon-move', :title => 'Mantenga click y arrastre para reordenar' %\>" if @con_orden %>
|
6
6
|
<%%= link_to 'Editar' , <%= @edit_path %>(<%= @singular %>), :class => 'btn btn-mini' if can? :editar, <%= @singular %> %>
|
7
7
|
<%%= link_to "Eliminar", <%= @singular_path %>(<%= @singular %>), :method => :delete, :confirm => t("confirmacion"), :remote => true, :class => 'btn btn-mini btn-danger' %>
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foldscaf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-03-
|
12
|
+
date: 2012-03-10 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Generadores adaptados a las necesidades de Xaver
|
15
15
|
email:
|
@@ -19,6 +19,7 @@ extensions: []
|
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
21
|
- .gitignore
|
22
|
+
- CHANGELOG.md
|
22
23
|
- Gemfile
|
23
24
|
- README.md
|
24
25
|
- Rakefile
|
@@ -29,7 +30,6 @@ files:
|
|
29
30
|
- lib/generators/fold/fold_generator.rb
|
30
31
|
- lib/generators/fold/templates/cargar.erb
|
31
32
|
- lib/generators/fold/templates/controller.erb
|
32
|
-
- lib/generators/fold/templates/helper.erb
|
33
33
|
- lib/generators/fold/templates/migration.erb
|
34
34
|
- lib/generators/fold/templates/model.erb
|
35
35
|
- lib/generators/fold/templates/views/_form.erb
|