programmable_scaffold_rails 0.0.2 → 0.0.3

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: 1fd5eead3a11c4c4b4856264e9ce633d12aad3a6
4
- data.tar.gz: 5bb03a34bfad4492c8a98c1e9463eec0fd127ddc
3
+ metadata.gz: 1ba8778bb703b422fa25b4324fb233d328f2c997
4
+ data.tar.gz: 873e8bdbda1d9a29161c9bdeea07bcf9b5a13c72
5
5
  SHA512:
6
- metadata.gz: 4770bb93ac76bd5b5ff6c2bded6b17630953bb13eb85732e6905bca7b800bf9d01e588f42e7fa6a78487b6940fcbb175a0cc5540fc6a8130460083f2fb2f20fa
7
- data.tar.gz: 6c85ce9fc00f26d97b96334111d8efa29fba7d26e83729cb53fffb6b89d6b7fc0ab78f94dfcbc99e0ec2f52d8498a9ac6d26ac72d1b2f035924d80f91239be69
6
+ metadata.gz: eb8c15677fae546436235a9216313f114294db16975039853a459d1c3307c624b28f5bc1390def6bb5cadc20da14dbb8e13cdf540c1467b1b81b0829a98d02c6
7
+ data.tar.gz: 77f178cb291d34c2b582e4ecd1b5c312308b9819358dfe81aa6601552c203a07216f84cbbca80ac1cf8f458276a3da2daa7a010c672636e03f97c45174fcab72
data/README.md CHANGED
@@ -8,7 +8,7 @@ It's also configurable, to avoid as most as possible to completely override one
8
8
 
9
9
  Add this line to your application's Gemfile:
10
10
 
11
- gem 'programmable_scaffold_rails', '~> 0.0.2'
11
+ gem 'programmable_scaffold_rails', '~> 0.0.3'
12
12
 
13
13
  And then execute:
14
14
 
@@ -40,20 +40,20 @@ used internally for specs.
40
40
  ### Available options
41
41
  | Name | Type | Default | Notes |
42
42
  |------|------|---------|-------|
43
- | class\_name | String | `controller.controller_name.to_s` | If set, replace the auto-calculated model class name |
44
- | table\_name | String | `class_name.tableize` | This is used to name instance variables of a model, if set, it won't be auto-calculated |
45
- | single\_instance\_name | String | `table_name.singularize` | Used when setting the instance variable for actions such as `new`, `edit`, `show`, `create`, `update` and `destroy` which can be used in the view |
46
- | multiple\_instances\_name | String | `table_name.pluralize` | Used when setting the instance variable for action such as `index` which can be used in the view |
43
+ | class\_name | String | model class name | If set, replace the auto-calculated model class name |
44
+ | table\_name | String | tableized class name | This is used to name instance variables of a model, if set, it won't be auto-calculated |
45
+ | single\_instance\_name | String | singularized table name | Used when setting the instance variable for actions such as `new`, `edit`, `show`, `create`, `update` and `destroy` which can be used in the view |
46
+ | multiple\_instances\_name | String | pluralized table name | Used when setting the instance variable for action such as `index` which can be used in the view |
47
47
  | cancan | bool | true | Enable cancan support which calls authorize! before each CRUD action |
48
48
  | friendly\_id | bool | false | Enable `friendly_id` support, if your model uses `friendly_id`, that will be used for finding the model object |
49
49
  | strong\_params | Symbol | :model_params | Name of existing method in controller, which should return params hash filtered by strong_parameters |
50
- | url_\namespace | String | Empty string | When generating urls for `after_create_url`, `after_update_url` and `after_destroy_url`, a namespace will be prepended if this is set |
51
- | after\_create\_action | Nil/Symbol | :show | One of `nil`, `:show`, `:edit`. `nil` and `:show` are the same |
52
- | after\_update\_action | Nil/Symbol | :show | See `after_create_action` |
53
- | after\_create\_url | Nil/Symbol/Proc/String | nil | If `nil` is set, the url will be auto generated with `url_namespace` and using the `after_create_action` for the given model object. If `Symbol` is used, a method with that name will be searched in controller and called with model instance as argument, it must generate a valid url. If proc is used, it will be called with model instance as argument. If a `String` is used, it will be directly passed to `url_for` to generate an url |
54
- | after\_update\_url | Nil/Symbol/Proc/String | nil | See `after_create_url` |
55
- | after\_destroy\_url | Nil/Symbol/Proc/String | nil | See `after_destroy_url` |
56
- | formats | Array of Symbols | [:html, :json] | Formats returned by the CRUD actions for controller |
50
+ | url\_namespace | String | Empty string | When generating urls for `after_create_url`, `after_update_url` and `after_destroy_url`, a namespace will be prepended if this is set |
51
+ | after\_create\_action | Nil, Symbol | :show | One of `nil`, `:show`, `:edit`. `nil` and `:show` are the same |
52
+ | after\_update\_action | Nil, Symbol | :show | See `after_create_action` |
53
+ | after\_create\_url | Nil, Symbol, Proc, String | nil | If `nil` is set, the url will be auto generated with `url_namespace` and using the `after_create_action` for the given model object. If `Symbol` is used, a method with that name will be searched in controller and called with model instance as argument, it must generate a valid url. If proc is used, it will be called with model instance as argument. If a `String` is used, it will be directly passed to `url_for` to generate an url |
54
+ | after\_update\_url | Nil, Symbol, Proc, String | nil | See `after_create_url` |
55
+ | after\_destroy\_url | Nil, Symbol, Proc, String | nil | See `after_destroy_url` |
56
+ | formats | Array of Symbols | [ :html, :json ] | Formats returned by the CRUD actions for controller |
57
57
 
58
58
  ### Example
59
59
 
@@ -96,7 +96,7 @@ You can change these keys in your locales to have your application easily locali
96
96
  #### Regarding model_class
97
97
 
98
98
  Model class is auto-calculated with `model_instance.class.model_name.human`, if you localize your model
99
- class following rails standards, you shouldn't have any problem.
99
+ class following Rails standards, you shouldn't have any problem.
100
100
 
101
101
  ## Features
102
102
 
@@ -105,6 +105,7 @@ class following rails standards, you shouldn't have any problem.
105
105
 
106
106
  # TODO
107
107
 
108
+ - Improve readme by explaining what each "scaffold" action does
108
109
  - Add I18n keys to completely replace those with `model_class`, if for example someone want to insert custom messages for each controller, something like `programmable_scaffold_rails.<controller_name>.after_create_notice`
109
110
 
110
111
  ## Contributing
@@ -0,0 +1,8 @@
1
+ it:
2
+ programmable_scaffold_rails:
3
+ after_create_notice: "%{model_class} è stato creato correttamente."
4
+ after_update_notice: "%{model_class} è stato modificato correttamente."
5
+ after_destroy_notice: "%{model_class} è stato eliminato correttamente."
6
+ after_create_alert: "%{model_class} non può essere creato."
7
+ after_update_alert: "%{model_class} non può essere modificato."
8
+ after_destroy_alert: "%{model_class} non può essere eliminato."
@@ -1,3 +1,3 @@
1
1
  module ProgrammableScaffoldRails
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: programmable_scaffold_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fire-Dragon-DoL
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-25 00:00:00.000000000 Z
11
+ date: 2013-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -197,6 +197,7 @@ files:
197
197
  - config.ru
198
198
  - config/action_controller.yml
199
199
  - config/locales/en.yml
200
+ - config/locales/it.yml
200
201
  - lib/programmable_scaffold_rails.rb
201
202
  - lib/programmable_scaffold_rails/action_controller_extensions.rb
202
203
  - lib/programmable_scaffold_rails/action_controller_helpers.rb