godmin 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7651d3e37543f3c1191f969075917796dd3a7fd1
4
- data.tar.gz: fae4e6570feaa75d32bc26862b2df6f2e0da657c
3
+ metadata.gz: bf754a62e429cbf72f011792ddbd02b7c4d3037d
4
+ data.tar.gz: 8a19bfc45fac23a39656db9134fbcccca9996195
5
5
  SHA512:
6
- metadata.gz: 57d38de96f1be3c647afdb7f45bba6730907bce428106bf5ea41912061519e4fcaf7daa51d673379eec07f60b2597fa47ab57109c9d586197b5037fa28a9ce79
7
- data.tar.gz: 3cbc018639fb754864aa67e51cb5054cabfbe9327581e91b9e9f32d0b9821770dc05df6be424232eb43f22cb4cfc3c29f0f7176f52b619982aaadbc16fb321e2
6
+ metadata.gz: 1564e32053544f65e81a89ecf4738d319649e6cadc8782be6bf03d1a69b20ee5d46cb4cddc628ea65dc62045de0cdd852cc5bb57991f1c85947f532f84b0252c
7
+ data.tar.gz: 0e65e90a7a924e2e399d07324857a9f080b9abe347bcf0a1ad60e2ff31c0e1079f771e57fc903734400d25c38b246dc5b4f49d883b51e8e60da6f3efc8452796
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ### 0.9.4 - 2014-12-15
4
+ Features
5
+ - Added Godmin::FormBuilder
6
+
3
7
  ### 0.9.3 - 2014-12-10
4
8
  Bug fixes
5
9
  - Pagination offset fix
data/README.md CHANGED
@@ -17,6 +17,7 @@ Godmin is an admin engine for Rails 4+.
17
17
  - [Batch actions](#batch-actions)
18
18
  - [Resource fetching](#resource-fetching)
19
19
  - [Redirecting](#redirecting)
20
+ - [Pagination](#pagination)
20
21
  - [Views](#views)
21
22
  - [Models](#models)
22
23
  - [Authentication](#authentication)
@@ -350,6 +351,20 @@ class ResourceController < ApplicationController
350
351
  end
351
352
  ```
352
353
 
354
+ ### Pagination
355
+
356
+ If you wish to change the number of resources per page, you can override the `per_page` class method in the controller:
357
+
358
+ ```ruby
359
+ class ArticlesController
360
+ include Godmin::Resource
361
+
362
+ def self.per_page
363
+ 50
364
+ end
365
+ end
366
+ ```
367
+
353
368
  ## Views
354
369
 
355
370
  It is easy to override view templates and partials in Godmin, both globally and per resource. All you have to do is place a file with an identical name in your `app/views` directory. For instance, to override the `godmin/resource/index.html.erb` template for all resources, place a file under `app/views/resource/index.html.erb`. If you only wish to override it for articles, place it instead under `app/views/articles/index.html.erb`.
@@ -1,4 +1,5 @@
1
1
  require "godmin/helpers/application"
2
+ require "godmin/helpers/forms"
2
3
  require "godmin/helpers/translations"
3
4
 
4
5
  module Godmin
@@ -9,6 +10,7 @@ module Godmin
9
10
  include Godmin::Helpers::Translations
10
11
 
11
12
  helper Godmin::Helpers::Application
13
+ helper Godmin::Helpers::Forms
12
14
  helper Godmin::Helpers::Translations
13
15
 
14
16
  helper_method :authentication_enabled?
@@ -0,0 +1,13 @@
1
+ module Godmin
2
+ module Helpers
3
+ module Forms
4
+ def form_for(record, options = {}, &block)
5
+ super do |form_builder|
6
+ yield Godmin::FormBuilder.new(form_builder)
7
+ end
8
+ end
9
+ end
10
+ end
11
+
12
+ class FormBuilder < SimpleDelegator; end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module Godmin
2
- VERSION = "0.9.3"
2
+ VERSION = "0.9.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: godmin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Ljungblad
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-12-10 00:00:00.000000000 Z
13
+ date: 2014-12-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bcrypt
@@ -206,6 +206,7 @@ files:
206
206
  - lib/godmin/helpers/application.rb
207
207
  - lib/godmin/helpers/batch_actions.rb
208
208
  - lib/godmin/helpers/filters.rb
209
+ - lib/godmin/helpers/forms.rb
209
210
  - lib/godmin/helpers/tables.rb
210
211
  - lib/godmin/helpers/translations.rb
211
212
  - lib/godmin/rails.rb