rows_controller 3.1.7 → 3.2.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3190f7a28ec52906194dcfb666e81f9dd6f2f98e46c4a7eeec97831f3b835b0
4
- data.tar.gz: f1fcbe4248ebb0aed3c8b36aa792b68a864b6f224dfd7cf225ebc58db401310d
3
+ metadata.gz: e05033a1488d34ffdf4e06a4ae953bb3f6c68d1cc1e6424401c76c0fac9c7e62
4
+ data.tar.gz: bf2efad0016a0a343b4e44018a2ea3608fcda142f68883cdf2d5220bf74cb4fb
5
5
  SHA512:
6
- metadata.gz: 3e44768c0302b799674cfdb8a5f92752b591dce3537a92a8a53488ceb658e310bdff3e8ae37b2ff39b765d82ec27519bf9b9cea2fb2f0d18bcc3161da19beb10
7
- data.tar.gz: a8bbcd759348b05a5413680b8eff3a8a7ec718bd658f762c8ff94101ac3f9083798923210ed1ae3b7987686184b2c34a009223180cfd52efad79db261b93d33d
6
+ metadata.gz: f1c418118a3314d71da159ee8bcc648d3d72c8a683b90596a38b92f25ba10b37fdc262bc4a4439bd0fde977de241f528b4651272c3987b223ee7abd4562d16fb
7
+ data.tar.gz: 0bc3da421cebaba79d0ede4e16946419a151019fb72d6b85510005f91dd2dde0f9938baa91f799d98f69869e07847fa718e20c7302635ce5a5d18f3f89862b36
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012-2024 Dittmar Krall (www.matiq.com)
1
+ Copyright (c) 2012-2025 Dittmar Krall (www.matiq.com)
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,17 +1,18 @@
1
1
  # RowsController
2
- [![Gem Version](https://badge.fury.io/rb/rows_controller.svg)](https://badge.fury.io/rb/rows_controller)
3
- [![GEM Downloads](https://img.shields.io/gem/dt/rows_controller?color=168AFE&logo=ruby&logoColor=FE1616)](https://rubygems.org/gems/rows_controller)
4
- [![rake](https://github.com/matique/rows_controller/actions/workflows/rake.yml/badge.svg)](https://github.com/matique/rows_controller/actions/workflows/rake.yml)
5
- [![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/standardrb/standard)
6
- [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](http://choosealicense.com/licenses/mit/)
2
+
3
+ [![Gem Version](https://img.shields.io/gem/v/rows_controller?color=168AFE&logo=rubygems&logoColor=FE1616)](https://rubygems.org/gems/rows_controller)
4
+ [![Downloads](https://img.shields.io/gem/dt/rows_controller?color=168AFE&logo=rubygems&logoColor=FE1616)](https://rubygems.org/gems/rows_controller)
5
+ [![GitHub Build](https://img.shields.io/github/actions/workflow/status/matique/rows_controller/rake.yml?logo=github)](https://github.com/matique/rows_controller/actions/workflows/rake.yml)
6
+ [![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-168AFE.svg)](https://github.com/standardrb/standard)
7
+ [![MIT License](https://img.shields.io/badge/license-MIT-168AFE.svg)](http://choosealicense.com/licenses/mit/)
7
8
 
8
9
  DRYs Rails controllers. Imagine replacing that @order by 'resource' in the
9
- controllers/views and, imho, an area for DRYing appears.
10
+ controllers/views and, IMHO, an area for DRYing appears.
10
11
  Instead of:
11
12
 
12
13
  ~~~ruby
13
14
  class OrdersController < ApplicationController
14
- .....
15
+ ..... # quite a lot of lines from "rails generate scaffold ..."
15
16
  private
16
17
  def order_params
17
18
  params.require(:order).permit(:name)
@@ -30,10 +31,10 @@ class OrdersController < RowsController # < ApplicationController
30
31
  end
31
32
  ~~~
32
33
 
33
- I.e. RowsController defines all the usual methods (index, show, edit,...).
34
+ I.e. _RowsController_ defines all the usual methods (index, show, edit,...).
34
35
 
35
36
  The methods may be redefined in OrdersController
36
- (overwrites methods from RowsController).
37
+ (overwrites methods from _RowsController_).
37
38
 
38
39
  Low level methods like 'resources' may be redefined as well.
39
40
  An example:
@@ -44,21 +45,21 @@ def resources
44
45
  end
45
46
  ~~~
46
47
 
47
- RowsController inherites from ApplicationController, i.e. all the helpers
48
+ _RowsController_ inherites from ApplicationController, i.e. all the helpers
48
49
  defined there will be available.
49
50
 
50
51
 
51
52
  ## Customizing of views
52
53
 
53
- RowsController initializes some instance variables used in the views
54
+ _RowsController_ initializes some instance variables used in the views
54
55
  (e.g. @order, @orders; legacy @row & @rows are still supported).
55
56
  Furthermore, the helpers resource, resources, set_resource and
56
57
  set_resources are available. You guess their usage.
57
58
 
58
59
  Providing e.g. an "#{Rails.root}/app/views/order/index.html.erb"
59
- overwrites the default RowsController view as Rails will first look
60
+ overwrites the default _RowsController_ view as Rails will first look
60
61
  into the directory "#{Rails.root}/app/views" before looking
61
- into the RowsController.
62
+ into the _RowsController_.
62
63
 
63
64
  Similarly, partials '\_row\_buttons' and '\_list\_footer' may be overwritten
64
65
  as well.
@@ -66,7 +67,7 @@ as well.
66
67
 
67
68
  ## model_class
68
69
 
69
- RowsController guesses the model from params[:controller]. This can
70
+ _RowsController_ guesses the model from params[:controller]. This can
70
71
  be changed by:
71
72
 
72
73
  ~~~ruby
@@ -78,9 +79,16 @@ class OrdersController < RowsController
78
79
  The model class can be retrieved with the helper model_class.
79
80
 
80
81
 
82
+ ## Rails 8
83
+
84
+ _RowsController_ 3.2.* is intended for Rails 8+.
85
+ In particular, *turbo stream* is used for row deletion.
86
+ Older Rails versions may use "gem 'rows_controller', '= 3.1.7'".
87
+
88
+
81
89
  ## Rails 7
82
90
 
83
- RowsController 3.1.* is intended for Rails 7.
91
+ _RowsController_ 3.1.* is intended for Rails 7.
84
92
  In particular Hotwire caused some quirks
85
93
  which are handled by this version.
86
94
  Compatibility with older Rails versions are not intended
@@ -127,9 +135,9 @@ a class method which returns the columns defined by the ActiveRecord model.
127
135
  As usual:
128
136
 
129
137
  ~~~ruby
130
- gem 'rows_controller' # in Gemfile
138
+ gem "rows_controller" # in Gemfile
131
139
  bundle
132
- ( cd spec/dummy; rake db:create db:migrate ) # not required for Rails 6
140
+ ( cd spec/dummy; rake db:create db:migrate ) # not required for Rails 6+
133
141
  rake
134
142
  ~~~
135
143
 
@@ -145,5 +153,5 @@ Look for:
145
153
 
146
154
  ## Miscellaneous
147
155
 
148
- Copyright (c) 2009-2024 Dittmar Krall (www.matiq.com),
156
+ Copyright (c) 2009-2025 Dittmar Krall (www.matiq.com),
149
157
  released under the [MIT license](https://opensource.org/licenses/MIT).
@@ -63,7 +63,7 @@ class RowsController < ApplicationController
63
63
  respond_to do |format|
64
64
  format.html { redirect_to action: :index }
65
65
  format.json { head :no_content }
66
- # format.turbo_stream {} # outcomment for backward compatibility
66
+ format.turbo_stream {} # outcomment for backward compatibility
67
67
  end
68
68
  end
69
69
 
data/lib/rows/model.rb CHANGED
@@ -2,10 +2,8 @@
2
2
 
3
3
  module Rows::Model
4
4
  def model_class
5
- # rubocop: disable
6
5
  @_model_class ||= self.class.model_class ||
7
6
  Kernel.const_get(params[:controller].classify)
8
- # rubocop: enable
9
7
  end
10
8
 
11
9
  if Rails::VERSION::MAJOR > 3
data/lib/rows/version.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  module Rows
2
- VERSION = "3.1.7" # 2024-12-10
2
+ VERSION = "3.2.1" # 2025-06-23
3
+ # VERSION = "3.2.0" # 2025-02-10
4
+ # VERSION = "3.1.7" # 2024-12-10
3
5
  # VERSION = "3.1.6" # 2024-09-07
4
6
  # VERSION = "3.1.5" # 2024-02-18
5
7
  # VERSION = "3.1.4" # 2024-02-18
@@ -1,5 +1,7 @@
1
1
  module Rows
2
- VERSION = "3.1.6" # 2024-09-07
2
+ VERSION = "3.2.0" # 2025-02-10
3
+ # VERSION = "3.1.7" # 2024-12-10
4
+ # VERSION = "3.1.6" # 2024-09-07
3
5
  # VERSION = "3.1.5" # 2024-02-18
4
6
  # VERSION = "3.1.4" # 2024-02-18
5
7
  # VERSION = "3.1.3" # 2023-12-09
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rows_controller
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.7
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dittmar Krall
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-12-10 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: bundler
@@ -119,23 +118,21 @@ licenses:
119
118
  - MIT
120
119
  metadata:
121
120
  source_code_uri: https://github.com/matique/rows_controller
122
- post_install_message:
123
121
  rdoc_options: []
124
122
  require_paths:
125
123
  - lib
126
124
  required_ruby_version: !ruby/object:Gem::Requirement
127
125
  requirements:
128
- - - ">="
126
+ - - "~>"
129
127
  - !ruby/object:Gem::Version
130
- version: '0'
128
+ version: '3'
131
129
  required_rubygems_version: !ruby/object:Gem::Requirement
132
130
  requirements:
133
131
  - - ">="
134
132
  - !ruby/object:Gem::Version
135
133
  version: '0'
136
134
  requirements: []
137
- rubygems_version: 3.5.23
138
- signing_key:
135
+ rubygems_version: 3.6.7
139
136
  specification_version: 4
140
137
  summary: RowsController DRYs your controllers.
141
138
  test_files: []