casein 3.1.1 → 3.1.2
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/README.rdoc +1 -1
- data/app/helpers/casein/casein_helper.rb +10 -1
- data/lib/generators/casein/scaffold/templates/controller.rb +1 -1
- data/lib/generators/casein/scaffold/templates/views/_table.html.erb +1 -1
- data/lib/generators/casein/scaffold/templates/views/index.html.erb +1 -1
- data/lib/generators/casein/update/templates/public/casein/stylesheets/elements.css +1 -1
- metadata +4 -4
data/PUBLIC_VERSION.yml
CHANGED
data/README.rdoc
CHANGED
@@ -199,7 +199,7 @@ All of the standard Rails form helpers are available, but the Casein versions ar
|
|
199
199
|
casein_file_field form, model, object_name, attribute, options = {}
|
200
200
|
casein_hidden_field form, model, attribute, options = {}
|
201
201
|
|
202
|
-
For more information on each function, check the casein_helper.rb file within the project. The method parameters are typically the same as the Rails form tag helpers. There are some extra Casein options that can be passed through as part of the options hash:
|
202
|
+
For more information on each function, check the app/helpers/casein/casein_helper.rb file within the project. The method parameters are typically the same as the Rails form tag helpers. There are some extra Casein options that can be passed through as part of the options hash:
|
203
203
|
|
204
204
|
:casein_label – by default the humanized version of the database field name is used as the label, but this will override it with a string of your choice.
|
205
205
|
:casein_button_label – available in casein_radio_button and casein_check_box. Used to give individual buttons their labels.
|
@@ -45,7 +45,16 @@ module Casein
|
|
45
45
|
contents = truncate(contents, :length => options[:casein_truncate], :omission => "...")
|
46
46
|
end
|
47
47
|
|
48
|
-
link_to "#{contents}", link
|
48
|
+
link_to "#{contents}".html_safe, link, options
|
49
|
+
end
|
50
|
+
|
51
|
+
def casein_table_cell_no_link contents, options = {}
|
52
|
+
|
53
|
+
if options.key? :casein_truncate
|
54
|
+
contents = truncate(contents, :length => options[:casein_truncate], :omission => "...")
|
55
|
+
end
|
56
|
+
|
57
|
+
"<div class='noLink'>#{contents}</div>".html_safe
|
49
58
|
end
|
50
59
|
|
51
60
|
def casein_show_icon icon_name
|
@@ -49,7 +49,7 @@ module Casein
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def destroy
|
52
|
-
@<%= singular_name %> = <%= class_name %>.
|
52
|
+
@<%= singular_name %> = <%= class_name %>.find params[:id]
|
53
53
|
|
54
54
|
@<%= singular_name %>.destroy
|
55
55
|
flash[:notice] = '<%= singular_name.humanize.capitalize %> has been deleted'
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<% end %><th> </th>
|
7
7
|
</tr>
|
8
8
|
|
9
|
-
<%%
|
9
|
+
<%% <%= plural_name %>.each_with_index do |<%= singular_name %>, index| %>
|
10
10
|
<tr class="<%%= 'even' if index.modulo(2) == 0 %> hover">
|
11
11
|
<% attributes.each do |attribute| %><td><%%= casein_table_cell_link <%= singular_name %>.<%= attribute.name %>, casein_<%= singular_name %>_path(<%= singular_name %>) %></td>
|
12
12
|
<% end %><td class="delete">
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
<h2><%= plural_name.humanize.capitalize %></h2>
|
4
4
|
|
5
|
-
<%%= render :partial => 'casein/<%= plural_name %>/table' %>
|
5
|
+
<%%= render :partial => 'casein/<%= plural_name %>/table', :locals => { :<%= plural_name %> => @<%= plural_name %> } %>
|
6
6
|
|
7
7
|
<%%= will_paginate @<%= plural_name %> %>
|
8
8
|
|
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: 7
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 3.1.
|
9
|
+
- 2
|
10
|
+
version: 3.1.2
|
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-08-
|
19
|
+
date: 2010-08-31 00:00:00 +02:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|