flexi_generators 0.2.10 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +29 -0
- data/Rakefile +2 -16
- data/flexi_generators.gemspec +17 -114
- data/lib/flexi_generators.rb +11 -0
- data/lib/generators/flexi/config/config_generator.rb +25 -0
- data/lib/generators/flexi/config/templates/field_error.rb +9 -0
- data/lib/generators/flexi/config/templates/inflector_portuguese.rb +62 -0
- data/lib/generators/flexi/config/templates/pt-BR.yml +224 -0
- data/lib/generators/flexi/config/templates/will_paginate.rb +26 -0
- data/lib/generators/flexi/install/install_generator.rb +28 -0
- data/lib/generators/flexi/install/templates/application.css +15 -0
- data/lib/generators/flexi/install/templates/application.js +16 -0
- data/lib/generators/flexi/layout/layout_generator.rb +46 -0
- data/lib/generators/flexi/layout/templates/_flash.html.erb +4 -0
- data/lib/generators/flexi/layout/templates/_navbar.html.erb +6 -0
- data/lib/generators/flexi/layout/templates/_sidebar.html.erb +16 -0
- data/lib/generators/flexi/layout/templates/_user_dropdown.html.erb +11 -0
- data/lib/generators/flexi/layout/templates/application.css +16 -0
- data/lib/generators/flexi/layout/templates/dashboard.html.erb +49 -0
- data/lib/generators/flexi/layout/templates/error_messages_helper.rb +33 -0
- data/lib/generators/flexi/layout/templates/layout.css +8 -0
- data/lib/generators/flexi/layout/templates/layout.html.erb +76 -0
- data/lib/generators/flexi/layout/templates/layout_helper.rb +47 -0
- data/lib/generators/flexi/scaffold/scaffold_generator.rb +24 -109
- data/lib/generators/flexi/scaffold/templates/_form.html.erb +22 -0
- data/lib/generators/flexi/scaffold/templates/edit.html.erb +1 -0
- data/lib/generators/flexi/scaffold/templates/index.html.erb +36 -0
- data/lib/generators/flexi/scaffold/templates/new.html.erb +1 -0
- data/lib/generators/flexi/scaffold/templates/show.html.erb +21 -0
- data/lib/twitter-bootstrap/engine.rb +6 -0
- data/lib/twitter-bootstrap/railtie.rb +6 -0
- data/lib/twitter-bootstrap/version.rb +5 -0
- data/lib/version.rb +3 -0
- data/vendor/assets/images/glyphicons-halflings-white.png +0 -0
- data/vendor/assets/images/glyphicons-halflings.png +0 -0
- data/vendor/assets/javascripts/bootstrap.js +1825 -0
- data/vendor/assets/stylesheets/bootstrap-responsive.css +815 -0
- data/vendor/assets/stylesheets/bootstrap.css +4983 -0
- metadata +51 -89
- data/README.textile +0 -64
- data/VERSION +0 -1
- data/lib/generators/flexi.rb +0 -16
- data/lib/generators/flexi/auth/USAGE +0 -5
- data/lib/generators/flexi/auth/auth_generator.rb +0 -122
- data/lib/generators/flexi/auth/templates/authentication.rb +0 -55
- data/lib/generators/flexi/auth/templates/authlogic_session.rb +0 -2
- data/lib/generators/flexi/auth/templates/fixtures.yml +0 -24
- data/lib/generators/flexi/auth/templates/migration.rb +0 -16
- data/lib/generators/flexi/auth/templates/sessions_controller.rb +0 -26
- data/lib/generators/flexi/auth/templates/sessions_helper.rb +0 -2
- data/lib/generators/flexi/auth/templates/tests/testunit/sessions_controller.rb +0 -20
- data/lib/generators/flexi/auth/templates/tests/testunit/user.rb +0 -4
- data/lib/generators/flexi/auth/templates/tests/testunit/users_controller.rb +0 -23
- data/lib/generators/flexi/auth/templates/user.rb +0 -3
- data/lib/generators/flexi/auth/templates/users_controller.rb +0 -43
- data/lib/generators/flexi/auth/templates/users_helper.rb +0 -2
- data/lib/generators/flexi/auth/templates/views/erb/_error_messages.html.erb +0 -11
- data/lib/generators/flexi/auth/templates/views/erb/_menu.html.erb +0 -16
- data/lib/generators/flexi/auth/templates/views/erb/application.html.erb +0 -39
- data/lib/generators/flexi/auth/templates/views/erb/edit.html.erb +0 -24
- data/lib/generators/flexi/auth/templates/views/erb/index.html.erb +0 -27
- data/lib/generators/flexi/auth/templates/views/erb/login.html.erb +0 -22
- data/lib/generators/flexi/auth/templates/views/erb/new.html.erb +0 -24
- data/lib/generators/flexi/auth/templates/views/erb/show.html.erb +0 -16
- data/lib/generators/flexi/prepare/USAGE +0 -6
- data/lib/generators/flexi/prepare/prepare_generator.rb +0 -68
- data/lib/generators/flexi/prepare/templates/add.png +0 -0
- data/lib/generators/flexi/prepare/templates/admin_home_controller.rb +0 -6
- data/lib/generators/flexi/prepare/templates/admin_home_index.html.erb +0 -16
- data/lib/generators/flexi/prepare/templates/application.css +0 -279
- data/lib/generators/flexi/prepare/templates/application_helper.rb +0 -44
- data/lib/generators/flexi/prepare/templates/back.png +0 -0
- data/lib/generators/flexi/prepare/templates/bg.png +0 -0
- data/lib/generators/flexi/prepare/templates/bg2.png +0 -0
- data/lib/generators/flexi/prepare/templates/boxheader.gif +0 -0
- data/lib/generators/flexi/prepare/templates/btn-bg-hover.png +0 -0
- data/lib/generators/flexi/prepare/templates/btn-bg.png +0 -0
- data/lib/generators/flexi/prepare/templates/custom_field_error.rb +0 -12
- data/lib/generators/flexi/prepare/templates/delete.png +0 -0
- data/lib/generators/flexi/prepare/templates/edit.png +0 -0
- data/lib/generators/flexi/prepare/templates/inflector_portuguese.rb +0 -60
- data/lib/generators/flexi/prepare/templates/login.css +0 -142
- data/lib/generators/flexi/prepare/templates/login.html.erb +0 -26
- data/lib/generators/flexi/prepare/templates/logo.png +0 -0
- data/lib/generators/flexi/prepare/templates/menu.png +0 -0
- data/lib/generators/flexi/prepare/templates/messages/Thumbs.db +0 -0
- data/lib/generators/flexi/prepare/templates/messages/error.png +0 -0
- data/lib/generators/flexi/prepare/templates/messages/info.png +0 -0
- data/lib/generators/flexi/prepare/templates/messages/success.png +0 -0
- data/lib/generators/flexi/prepare/templates/messages/tip.png +0 -0
- data/lib/generators/flexi/prepare/templates/messages/warning.png +0 -0
- data/lib/generators/flexi/prepare/templates/pt-BR.yml +0 -206
- data/lib/generators/flexi/prepare/templates/routes.rb +0 -3
- data/lib/generators/flexi/prepare/templates/show.png +0 -0
- data/lib/generators/flexi/prepare/templates/site.css +0 -72
- data/lib/generators/flexi/prepare/templates/site.html.erb +0 -20
- data/lib/generators/flexi/prepare/templates/site_controller.rb +0 -9
- data/lib/generators/flexi/prepare/templates/site_helper.rb +0 -2
- data/lib/generators/flexi/prepare/templates/site_index.html.erb +0 -27
- data/lib/generators/flexi/prepare/templates/users.png +0 -0
- data/lib/generators/flexi/scaffold/USAGE +0 -5
- data/lib/generators/flexi/scaffold/templates/controller.rb +0 -43
- data/lib/generators/flexi/scaffold/templates/fixtures.yml +0 -9
- data/lib/generators/flexi/scaffold/templates/helper.rb +0 -2
- data/lib/generators/flexi/scaffold/templates/migration.rb +0 -14
- data/lib/generators/flexi/scaffold/templates/model.rb +0 -3
- data/lib/generators/flexi/scaffold/templates/tests/controller.rb +0 -50
- data/lib/generators/flexi/scaffold/templates/tests/helper.rb +0 -4
- data/lib/generators/flexi/scaffold/templates/tests/model.rb +0 -8
- data/lib/generators/flexi/scaffold/templates/views/erb/_error_messages.html.erb +0 -11
- data/lib/generators/flexi/scaffold/templates/views/erb/_form.html.erb +0 -13
- data/lib/generators/flexi/scaffold/templates/views/erb/edit.html.erb +0 -3
- data/lib/generators/flexi/scaffold/templates/views/erb/index.html.erb +0 -29
- data/lib/generators/flexi/scaffold/templates/views/erb/new.html.erb +0 -3
- data/lib/generators/flexi/scaffold/templates/views/erb/show.html.erb +0 -15
- data/template.rb +0 -15
@@ -1,26 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
|
5
|
-
<title><%%= "Área administrativa - #{ yield(:title) }" %></title>
|
6
|
-
<%%= stylesheet_link_tag 'login' %>
|
7
|
-
<%%= yield(:head) %>
|
8
|
-
<%%= csrf_meta_tag %>
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
<div id="logo">
|
12
|
-
<%%= image_tag("logo.png") %>
|
13
|
-
</div>
|
14
|
-
<div id="container">
|
15
|
-
<div class="box-header">
|
16
|
-
<%% if show_title? %>
|
17
|
-
<h2><%%= yield(:title) %></h2>
|
18
|
-
<%% end %>
|
19
|
-
</div>
|
20
|
-
<div class="box">
|
21
|
-
<%%= raw flash_messages %>
|
22
|
-
<%%= yield %>
|
23
|
-
</div>
|
24
|
-
</div>
|
25
|
-
</body>
|
26
|
-
</html>
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,206 +0,0 @@
|
|
1
|
-
pt-BR:
|
2
|
-
number:
|
3
|
-
format:
|
4
|
-
precision: 3
|
5
|
-
separator: ','
|
6
|
-
delimiter: '.'
|
7
|
-
significant: false
|
8
|
-
strip_insignificant_zeros: false
|
9
|
-
|
10
|
-
currency:
|
11
|
-
format:
|
12
|
-
format: '%u %n'
|
13
|
-
unit: 'R$'
|
14
|
-
separator: ','
|
15
|
-
delimiter: '.'
|
16
|
-
precision: 2
|
17
|
-
significant: false
|
18
|
-
strip_insignificant_zeros: false
|
19
|
-
|
20
|
-
percentage:
|
21
|
-
format:
|
22
|
-
delimiter: "."
|
23
|
-
|
24
|
-
precision:
|
25
|
-
format:
|
26
|
-
delimiter: "."
|
27
|
-
|
28
|
-
human:
|
29
|
-
format:
|
30
|
-
delimiter: ""
|
31
|
-
precision: 3
|
32
|
-
significant: true
|
33
|
-
strip_insignificant_zeros: true
|
34
|
-
|
35
|
-
storage_units:
|
36
|
-
format: "%n %u"
|
37
|
-
units:
|
38
|
-
byte:
|
39
|
-
one: "Byte"
|
40
|
-
other: "Bytes"
|
41
|
-
kb: "KB"
|
42
|
-
mb: "MB"
|
43
|
-
gb: "GB"
|
44
|
-
tb: "TB"
|
45
|
-
|
46
|
-
decimal_units:
|
47
|
-
format: "%n %u"
|
48
|
-
units:
|
49
|
-
unit: ""
|
50
|
-
thousand: "mil"
|
51
|
-
million:
|
52
|
-
one: milhão
|
53
|
-
other: milhões
|
54
|
-
billion:
|
55
|
-
one: bilhão
|
56
|
-
other: bilhões
|
57
|
-
trillion:
|
58
|
-
one: trilhão
|
59
|
-
other: trilhões
|
60
|
-
quadrillion:
|
61
|
-
one: quatrilhão
|
62
|
-
other: quatrilhões
|
63
|
-
|
64
|
-
date:
|
65
|
-
formats:
|
66
|
-
default: "%d/%m/%Y"
|
67
|
-
short: "%d de %B"
|
68
|
-
long: "%d de %B de %Y"
|
69
|
-
|
70
|
-
day_names: [Domingo, Segunda, Terça, Quarta, Quinta, Sexta, Sábado]
|
71
|
-
abbr_day_names: [Dom, Seg, Ter, Qua, Qui, Sex, Sáb]
|
72
|
-
|
73
|
-
month_names: [~, Janeiro, Fevereiro, Março, Abril, Maio, Junho, Julho, Agosto, Setembro, Outubro, Novembro, Dezembro]
|
74
|
-
abbr_month_names: [~, Jan, Fev, Mar, Abr, Mai, Jun, Jul, Ago, Set, Out, Nov, Dez]
|
75
|
-
|
76
|
-
order:
|
77
|
-
- :day
|
78
|
-
- :month
|
79
|
-
- :year
|
80
|
-
|
81
|
-
time:
|
82
|
-
formats:
|
83
|
-
default: "%A, %d de %B de %Y, %H:%M h"
|
84
|
-
short: "%d/%m, %H:%M h"
|
85
|
-
long: "%A, %d de %B de %Y, %H:%M h"
|
86
|
-
am: ""
|
87
|
-
pm: ""
|
88
|
-
|
89
|
-
datetime:
|
90
|
-
distance_in_words:
|
91
|
-
half_a_minute: 'meio minuto'
|
92
|
-
less_than_x_seconds:
|
93
|
-
one: 'menos de 1 segundo'
|
94
|
-
other: 'menos de %{count} segundos'
|
95
|
-
|
96
|
-
x_seconds:
|
97
|
-
one: '1 segundo'
|
98
|
-
other: '%{count} segundos'
|
99
|
-
|
100
|
-
less_than_x_minutes:
|
101
|
-
one: 'menos de um minuto'
|
102
|
-
other: 'menos de %{count} minutos'
|
103
|
-
|
104
|
-
x_minutes:
|
105
|
-
one: '1 minuto'
|
106
|
-
other: '%{count} minutos'
|
107
|
-
|
108
|
-
about_x_hours:
|
109
|
-
one: 'aproximadamente 1 hora'
|
110
|
-
other: 'aproximadamente %{count} horas'
|
111
|
-
|
112
|
-
x_days:
|
113
|
-
one: '1 dia'
|
114
|
-
other: '%{count} dias'
|
115
|
-
|
116
|
-
about_x_months:
|
117
|
-
one: 'aproximadamente 1 mês'
|
118
|
-
other: 'aproximadamente %{count} meses'
|
119
|
-
|
120
|
-
x_months:
|
121
|
-
one: '1 mês'
|
122
|
-
other: '%{count} meses'
|
123
|
-
|
124
|
-
about_x_years:
|
125
|
-
one: 'aproximadamente 1 ano'
|
126
|
-
other: 'aproximadamente %{count} anos'
|
127
|
-
|
128
|
-
over_x_years:
|
129
|
-
one: 'mais de 1 ano'
|
130
|
-
other: 'mais de %{count} anos'
|
131
|
-
|
132
|
-
almost_x_years:
|
133
|
-
one: 'quase 1 ano'
|
134
|
-
other: 'quase %{count} anos'
|
135
|
-
|
136
|
-
prompts:
|
137
|
-
year: "Ano"
|
138
|
-
month: "Mês"
|
139
|
-
day: "Dia"
|
140
|
-
hour: "Hora"
|
141
|
-
minute: "Minuto"
|
142
|
-
second: "Segundos"
|
143
|
-
|
144
|
-
support:
|
145
|
-
array:
|
146
|
-
words_connector: ", "
|
147
|
-
two_words_connector: " e "
|
148
|
-
last_word_connector: " e "
|
149
|
-
|
150
|
-
helpers:
|
151
|
-
select:
|
152
|
-
prompt: "Selecione"
|
153
|
-
|
154
|
-
submit:
|
155
|
-
create: 'Criar %{model}'
|
156
|
-
update: 'Alterar %{model}'
|
157
|
-
submit: 'Gravar %{model}'
|
158
|
-
|
159
|
-
errors:
|
160
|
-
format: "%{attribute} %{message}"
|
161
|
-
|
162
|
-
messages:
|
163
|
-
inclusion: "não está incluído na lista"
|
164
|
-
exclusion: "não está disponível"
|
165
|
-
invalid: "não é válido"
|
166
|
-
confirmation: "não está de acordo com a confirmação"
|
167
|
-
accepted: "deve ser aceito"
|
168
|
-
empty: "não pode ficar vazio"
|
169
|
-
blank: "não pode ficar em branco"
|
170
|
-
too_long: "é muito longo (máximo: %{count} caracteres)"
|
171
|
-
too_short: "é muito curto (mínimo: %{count} caracteres)"
|
172
|
-
wrong_length: "não possui o tamanho esperado (%{count} caracteres)"
|
173
|
-
not_a_number: "não é um número"
|
174
|
-
not_an_integer: "não é um número inteiro"
|
175
|
-
greater_than: "deve ser maior do que %{count}"
|
176
|
-
greater_than_or_equal_to: "deve ser maior ou igual a %{count}"
|
177
|
-
equal_to: "deve ser igual a %{count}"
|
178
|
-
less_than: "deve ser menor do que %{count}"
|
179
|
-
less_than_or_equal_to: "deve ser menor ou igual a %{count}"
|
180
|
-
odd: "deve ser ímpar"
|
181
|
-
even: "deve ser par"
|
182
|
-
|
183
|
-
attributes:
|
184
|
-
created_at: "Criado em"
|
185
|
-
updated_at: "Atulizado em"
|
186
|
-
|
187
|
-
activerecord:
|
188
|
-
errors:
|
189
|
-
messages:
|
190
|
-
taken: "já está em uso"
|
191
|
-
record_invalid: "A validação falhou: %{errors}"
|
192
|
-
attachment_size: "deve ter o tamanho entre %{min} e %{max} bytes"
|
193
|
-
models:
|
194
|
-
user: "Usuários"
|
195
|
-
|
196
|
-
attributes:
|
197
|
-
user:
|
198
|
-
username: "Usuário"
|
199
|
-
email: "E-mail"
|
200
|
-
password: "Senha"
|
201
|
-
password_confirmation: "Confirmar Senha"
|
202
|
-
|
203
|
-
authlogic:
|
204
|
-
error_messages:
|
205
|
-
email_invalid: "endereço de e-mail invávildo"
|
206
|
-
login_invalid: "use somente letras, números, espaços e .-_@"
|
Binary file
|
@@ -1,72 +0,0 @@
|
|
1
|
-
html { background: url('/images/bg.png');}
|
2
|
-
body {
|
3
|
-
margin:0;
|
4
|
-
padding:0;
|
5
|
-
background: url('/images/bg2.png') repeat-x top;
|
6
|
-
font-family: Arial,Helvetica,sans-serif;
|
7
|
-
font-size: 13px;
|
8
|
-
color: #333333;
|
9
|
-
}
|
10
|
-
a {text-decoration: none;}
|
11
|
-
a:hover {text-decoration: underline;}
|
12
|
-
div#header{ width: 800px; margin: 0 auto; padding-top: 10px; }
|
13
|
-
div#control_box {
|
14
|
-
background-color:#F3F3F3;
|
15
|
-
border:1px solid #E5E5E5;
|
16
|
-
padding:1px;
|
17
|
-
text-align:center;
|
18
|
-
}
|
19
|
-
div#title_box {
|
20
|
-
background-color:#F3F3F3;
|
21
|
-
border:1px solid #E5E5E5;
|
22
|
-
padding:1px;
|
23
|
-
text-align:center;
|
24
|
-
}
|
25
|
-
div#new_box { padding:15px 5px 5px 5px; }
|
26
|
-
.edit{color:#C5A059;}
|
27
|
-
.delete{color:#A02B2B;}
|
28
|
-
.new{
|
29
|
-
background: url(../images/add.png) no-repeat;
|
30
|
-
text-align: center;
|
31
|
-
font-size: 14px;
|
32
|
-
font-weight: bold;
|
33
|
-
padding-left: 17px;
|
34
|
-
color: #55A34A
|
35
|
-
}
|
36
|
-
.pagination{ margin-top: 15px; text-align: center; }
|
37
|
-
label { font-weight:bold; }
|
38
|
-
h1, h2 { padding:2px; margin:2px; }
|
39
|
-
a img { border: none; }
|
40
|
-
a { color: #0000FF; }
|
41
|
-
.clear { clear: both; height: 0; overflow: hidden; }
|
42
|
-
#container {
|
43
|
-
width: 800px;
|
44
|
-
overflow: auto;
|
45
|
-
margin: 0 auto;
|
46
|
-
margin-top: 10px;
|
47
|
-
}
|
48
|
-
/* Box */
|
49
|
-
.box {
|
50
|
-
background:#fff;
|
51
|
-
border:1px solid #c5c5c5;
|
52
|
-
margin-bottom:15px;
|
53
|
-
padding:15px;
|
54
|
-
border-top:0;
|
55
|
-
-moz-border-radius-bottomleft :5px;
|
56
|
-
-moz-border-radius-bottomright :5px;
|
57
|
-
-webkit-border-bottom-left-radius:5px;
|
58
|
-
-webkit-border-bottom-right-radius:5px;
|
59
|
-
}
|
60
|
-
.box-header {
|
61
|
-
border:1px solid #c5c5c5;
|
62
|
-
font-weight:bold;
|
63
|
-
font-size:14px;
|
64
|
-
background:#e2e2e2 url('/images/boxheader.gif') repeat-x top;
|
65
|
-
padding:10px 15px;
|
66
|
-
color:#333333;
|
67
|
-
text-shadow:1px 1px 1px #FFFFFF;
|
68
|
-
-moz-border-radius-topleft:5px;
|
69
|
-
-webkit-border-top-left-radius:5px;
|
70
|
-
-moz-border-radius-topright:5px;
|
71
|
-
-webkit-border-top-right-radius:5px;
|
72
|
-
}
|
@@ -1,20 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
|
5
|
-
<title><%%= "Página inicial - #{ yield(:title) }" %></title>
|
6
|
-
<%%= stylesheet_link_tag 'site' %>
|
7
|
-
<%%= yield(:head) %>
|
8
|
-
<%%= csrf_meta_tag %>
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
<div id="header">
|
12
|
-
<%%= link_to image_tag("logo.png"), root_path %>
|
13
|
-
</div>
|
14
|
-
<div id="container">
|
15
|
-
<%%= raw flash_messages %>
|
16
|
-
<%%= yield %>
|
17
|
-
</div>
|
18
|
-
<%%= analytics "UA-XXXXX" %>
|
19
|
-
</body>
|
20
|
-
</html>
|
@@ -1,27 +0,0 @@
|
|
1
|
-
<%% title("Site#index") %>
|
2
|
-
<div class="box-header">
|
3
|
-
<h1>Primeiros passos</h1>
|
4
|
-
</div>
|
5
|
-
<div class="box">
|
6
|
-
<ul>
|
7
|
-
<li>
|
8
|
-
<h2>Edite este layout em app/views/layouts/site.html.erb</h2>
|
9
|
-
<p>Crie seu layout, altere o logo e estilos.</p>
|
10
|
-
</li>
|
11
|
-
<li>
|
12
|
-
<h2>Edite esta página em app/views/site/index.html.erb</h2>
|
13
|
-
<p>Crie sua página inicial.</p>
|
14
|
-
</li>
|
15
|
-
<li>
|
16
|
-
<h2>Gere o cadastro de usuários e autenticação</h2>
|
17
|
-
<p>rails g flexi_auth</p>
|
18
|
-
<p>rake db:migrate</p>
|
19
|
-
<p>rake db:seed</p>
|
20
|
-
</li>
|
21
|
-
<li>
|
22
|
-
<h2>Depois acesse a área administrativa <a href="/admin">aqui</a></h2>
|
23
|
-
<p>Usuário: admin</p>
|
24
|
-
<p>Senha: admin123</p>
|
25
|
-
</li>
|
26
|
-
</ul>
|
27
|
-
</div>
|
Binary file
|
@@ -1,43 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
class Admin::<%= plural_class_name %>Controller < ApplicationController
|
3
|
-
menu_item :<%= plural_name %>
|
4
|
-
respond_to :html
|
5
|
-
|
6
|
-
def index
|
7
|
-
@<%= plural_name %> = <%= class_name %>.paginate :page => params[:page],
|
8
|
-
:per_page => 15
|
9
|
-
respond_with(:admin, @<%= plural_name %>)
|
10
|
-
end
|
11
|
-
|
12
|
-
def show
|
13
|
-
@<%= singular_name %> = <%= class_name %>.find(params[:id])
|
14
|
-
respond_with(:admin, @<%= singular_name %>)
|
15
|
-
end
|
16
|
-
|
17
|
-
def new
|
18
|
-
@<%= singular_name %> = <%= class_name %>.new
|
19
|
-
respond_with(:admin, @<%= singular_name %>)
|
20
|
-
end
|
21
|
-
|
22
|
-
def edit
|
23
|
-
@<%= singular_name %> = <%= class_name %>.find(params[:id])
|
24
|
-
end
|
25
|
-
|
26
|
-
def create
|
27
|
-
@<%= singular_name %> = <%= class_name %>.new(params[:<%= singular_name %>])
|
28
|
-
flash[:notice] = '<%= class_name %> foi criado com sucesso.' if @<%= singular_name %>.save
|
29
|
-
respond_with(:admin, @<%= singular_name %>)
|
30
|
-
end
|
31
|
-
|
32
|
-
def update
|
33
|
-
@<%= singular_name %> = <%= class_name %>.find(params[:id])
|
34
|
-
flash[:notice] = '<%= class_name %> foi alterado com sucesso.' if @<%= singular_name %>.update_attributes(params[:<%= singular_name %>])
|
35
|
-
respond_with(:admin, @<%= singular_name %>)
|
36
|
-
end
|
37
|
-
|
38
|
-
def destroy
|
39
|
-
@<%= singular_name %> = <%= class_name %>.find(params[:id])
|
40
|
-
flash[:notice] = '<%= class_name %> foi excluído com sucesso.' if @<%= singular_name %>.destroy
|
41
|
-
respond_with(:admin, @<%= singular_name %>)
|
42
|
-
end
|
43
|
-
end
|