casein 3.1.4 → 3.1.5
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.
- data/PUBLIC_VERSION.yml +1 -1
- data/app/helpers/casein/casein_helper.rb +1 -1
- data/lib/generators/casein/scaffold/scaffold_generator.rb +3 -1
- data/lib/generators/casein/scaffold/templates/controller.rb +3 -3
- data/lib/generators/casein/scaffold/templates/views/new.html.erb +3 -3
- data/lib/generators/casein/scaffold/templates/views/show.html.erb +2 -2
- data/lib/generators/casein/update/templates/public/casein/stylesheets/screen.css +17 -0
- metadata +4 -4
data/PUBLIC_VERSION.yml
CHANGED
@@ -153,7 +153,7 @@ module Casein
|
|
153
153
|
end
|
154
154
|
|
155
155
|
def casein_hidden_field form, obj, attribute, options = {}
|
156
|
-
form.hidden_field(
|
156
|
+
form.hidden_field(attribute, strip_casein_options(options)).html_safe
|
157
157
|
end
|
158
158
|
|
159
159
|
protected
|
@@ -18,6 +18,8 @@ module Casein
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def generate_files
|
21
|
+
@plural_route = (plural_name != singular_name) ? plural_name : "#{plural_name}_index"
|
22
|
+
|
21
23
|
template 'controller.rb', "app/controllers/casein/#{plural_name}_controller.rb"
|
22
24
|
template 'views/index.html.erb', "app/views/casein/#{plural_name}/index.html.erb"
|
23
25
|
template 'views/show.html.erb', "app/views/casein/#{plural_name}/show.html.erb"
|
@@ -59,7 +61,7 @@ module Casein
|
|
59
61
|
def add_to_navigation
|
60
62
|
puts " casein adding #{plural_name} to left navigation bar"
|
61
63
|
file_to_update = Rails.root + 'app/views/casein/layouts/_left_navigation.html.erb'
|
62
|
-
line_to_add = "<li id=\"visitSite\"><%= link_to \"#{plural_name.humanize.capitalize}\", casein_#{
|
64
|
+
line_to_add = "<li id=\"visitSite\"><%= link_to \"#{plural_name.humanize.capitalize}\", casein_#{@plural_route}_path %></li>"
|
63
65
|
insert_sentinel = '<!-- SCAFFOLD_INSERT -->'
|
64
66
|
gsub_add_once plural_name, file_to_update, line_to_add, insert_sentinel
|
65
67
|
end
|
@@ -27,7 +27,7 @@ module Casein
|
|
27
27
|
|
28
28
|
if @<%= singular_name %>.save
|
29
29
|
flash[:notice] = '<%= singular_name.humanize.capitalize %> created'
|
30
|
-
redirect_to casein_<%=
|
30
|
+
redirect_to casein_<%= @plural_route %>_path
|
31
31
|
else
|
32
32
|
flash.now[:warning] = 'There were problems when trying to create a new <%= singular_name.humanize.downcase %>'
|
33
33
|
render :action => :new
|
@@ -41,7 +41,7 @@ module Casein
|
|
41
41
|
|
42
42
|
if @<%= singular_name %>.update_attributes params[:<%= singular_name %>]
|
43
43
|
flash[:notice] = '<%= singular_name.humanize.capitalize %> has been updated'
|
44
|
-
redirect_to casein_<%=
|
44
|
+
redirect_to casein_<%= @plural_route %>_path
|
45
45
|
else
|
46
46
|
flash.now[:warning] = 'There were problems when trying to update this <%= singular_name.humanize.downcase %>'
|
47
47
|
render :action => :show
|
@@ -53,7 +53,7 @@ module Casein
|
|
53
53
|
|
54
54
|
@<%= singular_name %>.destroy
|
55
55
|
flash[:notice] = '<%= singular_name.humanize.capitalize %> has been deleted'
|
56
|
-
redirect_to casein_<%=
|
56
|
+
redirect_to casein_<%= @plural_route %>_path
|
57
57
|
end
|
58
58
|
|
59
59
|
end
|
@@ -2,17 +2,17 @@
|
|
2
2
|
|
3
3
|
<h2>Add a new <%= singular_name.humanize.downcase %></h2>
|
4
4
|
|
5
|
-
<%%= form_for @<%= file_name %>, :url => casein_<%=
|
5
|
+
<%%= form_for @<%= file_name %>, :url => casein_<%= @plural_route %>_path do |f| %>
|
6
6
|
|
7
7
|
<%%= render :partial => 'casein/<%= plural_name %>/form', :locals => { :f => f } %>
|
8
8
|
|
9
9
|
<p class="submits">
|
10
|
-
<%%= link_to 'Cancel', casein_<%=
|
10
|
+
<%%= link_to 'Cancel', casein_<%= @plural_route %>_path, :class => 'cancel' %> or
|
11
11
|
<%%= f.submit "Add new <%= singular_name.humanize.downcase %>", :class => "update" %>
|
12
12
|
</p>
|
13
13
|
|
14
14
|
<%% end %>
|
15
15
|
|
16
16
|
<%%= content_for :sidebar do %>
|
17
|
-
<li><%%= link_to "#{casein_show_icon "table"}Back to list".html_safe, casein_<%=
|
17
|
+
<li><%%= link_to "#{casein_show_icon "table"}Back to list".html_safe, casein_<%= @plural_route %>_path %></li>
|
18
18
|
<%% end %>
|
@@ -7,12 +7,12 @@
|
|
7
7
|
<%%= render :partial => 'casein/<%= plural_name %>/form', :locals => { :f => f } %>
|
8
8
|
|
9
9
|
<p class="submits">
|
10
|
-
<%%= link_to 'Cancel', casein_<%=
|
10
|
+
<%%= link_to 'Cancel', casein_<%= @plural_route %>_path, :class => 'cancel' %> or
|
11
11
|
<%%= f.submit "Save changes", :class => "update" %>
|
12
12
|
</p>
|
13
13
|
|
14
14
|
<%% end %>
|
15
15
|
|
16
16
|
<%%= content_for :sidebar do %>
|
17
|
-
<li><%%= link_to "#{casein_show_icon "table"}Back to list".html_safe, casein_<%=
|
17
|
+
<li><%%= link_to "#{casein_show_icon "table"}Back to list".html_safe, casein_<%= @plural_route %>_path %></li>
|
18
18
|
<%% end %>
|
@@ -22,6 +22,23 @@ img {
|
|
22
22
|
border: none;
|
23
23
|
}
|
24
24
|
|
25
|
+
a {
|
26
|
+
color: #333333;
|
27
|
+
text-decoration: underline;
|
28
|
+
}
|
29
|
+
|
30
|
+
a:hover {
|
31
|
+
color: #000000;
|
32
|
+
}
|
33
|
+
|
34
|
+
a:active {
|
35
|
+
color: #000000;
|
36
|
+
}
|
37
|
+
|
38
|
+
a:visited {
|
39
|
+
color: #000000;
|
40
|
+
}
|
41
|
+
|
25
42
|
.spacer {
|
26
43
|
width: 100%;
|
27
44
|
height: 150px;
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: casein
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 3.1.
|
9
|
+
- 5
|
10
|
+
version: 3.1.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Russell Quinn
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-09-
|
19
|
+
date: 2010-09-06 00:00:00 +02:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|