action_args 1.2.1 → 1.3.0

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: 56bb41c086b61cb8899219a054d6315b81fc0016
4
- data.tar.gz: 01a5389b849f8f86e2b5e895fe0431532ffb1315
3
+ metadata.gz: 934fd8b7952d38e30c4ddd6a38ae073f28ba622e
4
+ data.tar.gz: cd9f1a095d88748cdbeb2f0457711f59bfd70ebb
5
5
  SHA512:
6
- metadata.gz: 63f62e395be7b622d6f58985a0f92dd16816fe50c4c6e7fed8d18613b58881ce4efd42b07e50d9ada87dff781bd11b40e1253b848c25a56219702459228ec99d
7
- data.tar.gz: 29e576be7be35deacf9097253282733f86c275a5d8104df2331aa94ce3e3184dc94823e14f604a631ef972c419850fae1beeba58c0a50d7e9167983d5c6c02b0
6
+ metadata.gz: 27612eea7d1ed88309d165b557804f7c8be1a785ceb2e1734fc2401229726b308ab35e11a0c1f4b2b117401d905f76a6661a6bc12e3cc96e330f47ebe535453f
7
+ data.tar.gz: b9e3a78501ce177f5f30dfb25b5e99271ddd380699d4b5497216d9992c2648b452f231c95d073410411903c2aac4ca8842ed2273a9f565dde5391ee79014d2c7
data/.travis.yml CHANGED
@@ -2,6 +2,8 @@ script: "bundle exec rake spec"
2
2
  language: ruby
3
3
  rvm:
4
4
  - 1.9.3
5
+ - 2.0.0
6
+ - 2.1.0
5
7
  - ruby-head
6
8
  - jruby
7
9
  - rbx-19mode
data/README.md CHANGED
@@ -195,7 +195,7 @@ Then bundle:
195
195
 
196
196
  ### Plain Old Action Methods
197
197
 
198
- Of courese you still can use both Merbish style and plain old Rails style action methods even if this plugin is loaded. `params` parameter is still alive as well. That means, this plugin won't break any existing controller API.
198
+ Of course you still can use both Merbish style and plain old Rails style action methods even if this plugin is loaded. `params` parameter is still alive as well. That means, this plugin won't break any existing controller API.
199
199
 
200
200
  ### Argument Naming Convention
201
201
 
@@ -1,3 +1,3 @@
1
1
  module ActionArgs
2
- VERSION = '1.2.1'
2
+ VERSION = '1.3.0'
3
3
  end
@@ -32,7 +32,7 @@ class <%= controller_class_name %>Controller < ApplicationController
32
32
  if @<%= orm_instance.save %>
33
33
  redirect_to @<%= singular_table_name %>, notice: '<%= human_name %> was successfully created.'
34
34
  else
35
- render action: 'new'
35
+ render :new
36
36
  end
37
37
  end
38
38
 
@@ -40,10 +40,14 @@ class <%= controller_class_name %>Controller < ApplicationController
40
40
  def update(id, <%= singular_table_name %>)
41
41
  @<%= singular_table_name %> = <%= orm_class.find(class_name, 'id') %>
42
42
 
43
+ <% if orm_instance.respond_to? :update -%>
44
+ if @<%= orm_instance.update(singular_table_name) %>
45
+ <% else -%>
43
46
  if @<%= orm_instance.update_attributes(singular_table_name) %>
47
+ <% end -%>
44
48
  redirect_to @<%= singular_table_name %>, notice: '<%= human_name %> was successfully updated.'
45
49
  else
46
- render action: 'edit'
50
+ render :edit
47
51
  end
48
52
  end
49
53
 
@@ -52,6 +56,6 @@ class <%= controller_class_name %>Controller < ApplicationController
52
56
  @<%= singular_table_name %> = <%= orm_class.find(class_name, 'id') %>
53
57
  @<%= orm_instance.destroy %>
54
58
 
55
- redirect_to <%= index_helper %>_url
59
+ redirect_to <%= index_helper %>_url, notice: <%= "'#{human_name} was successfully destroyed.'" %>
56
60
  end
57
61
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_args
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akira Matsuda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-27 00:00:00.000000000 Z
11
+ date: 2014-05-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Rails plugin gem that supports Merbish style controller action arguments.
14
14
  email:
@@ -17,8 +17,8 @@ executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
- - .gitignore
21
- - .travis.yml
20
+ - ".gitignore"
21
+ - ".travis.yml"
22
22
  - Gemfile
23
23
  - MIT-LICENSE
24
24
  - README.md
@@ -52,17 +52,17 @@ require_paths:
52
52
  - lib
53
53
  required_ruby_version: !ruby/object:Gem::Requirement
54
54
  requirements:
55
- - - '>='
55
+ - - ">="
56
56
  - !ruby/object:Gem::Version
57
57
  version: '0'
58
58
  required_rubygems_version: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - '>='
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  requirements: []
64
64
  rubyforge_project: action_args
65
- rubygems_version: 2.0.3
65
+ rubygems_version: 2.2.2
66
66
  signing_key:
67
67
  specification_version: 4
68
68
  summary: Controller action arguments parameterizer for Rails 3+ & Ruby 1.9+
@@ -76,4 +76,3 @@ test_files:
76
76
  - spec/mailers/action_mailer_spec.rb
77
77
  - spec/params_handler/params_handler_spec.rb
78
78
  - spec/spec_helper.rb
79
- has_rdoc: