casein 3.1.1 → 3.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
1
  major: 3
2
2
  minor: 1
3
- patch: 1
3
+ patch: 2
4
4
  build:
@@ -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 %>.find_by_id params[:id]
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>&nbsp;</th>
7
7
  </tr>
8
8
 
9
- <%% @<%= plural_name %>.each_with_index do |<%= singular_name %>, index| %>
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
 
@@ -118,7 +118,7 @@
118
118
  text-decoration: none;
119
119
  }
120
120
 
121
- #content .itemList td.noLink {
121
+ #content .itemList td div.noLink {
122
122
  padding: 9px 8px 7px 8px;
123
123
  }
124
124
 
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: 1
4
+ hash: 7
5
5
  prerelease: false
6
6
  segments:
7
7
  - 3
8
8
  - 1
9
- - 1
10
- version: 3.1.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-25 00:00:00 +02:00
19
+ date: 2010-08-31 00:00:00 +02:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency