rails_admin_toggleable 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,16 +26,17 @@ module RailsAdmin
26
26
  method = params[:method]
27
27
  obj.send(method + '=', params[:on] == '1' ? true : false)
28
28
  if obj.save
29
- redirect_to :back, success: "OK"
29
+ flash[:success] = "OK"
30
30
  else
31
- redirect_to :back, error: obj.errors.full_messages.join(', ')
31
+ flash[:error] = obj.errors.full_messages.join(', ')
32
32
  end
33
33
  rescue Exception => e
34
- redirect_to :back, error: "Error: #{e}"
34
+ flash[:error] = "Error: #{e}"
35
35
  end
36
36
  else
37
- redirect_to :back, error: 'No ID'
37
+ flash[:error] = 'No ID'
38
38
  end
39
+ redirect_to :back
39
40
  end
40
41
  end
41
42
 
@@ -1,3 +1,3 @@
1
1
  module RailsAdminToggleable
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_admin_toggleable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: