faalis 2.0.7 → 2.0.8

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: 7e67dad743a6caeac4a9fb8b3dd3a84c0535a580
4
- data.tar.gz: 7bdbf46c6e8413407556431b272fc42138246c78
3
+ metadata.gz: 865303e83168a89d500b98d74a174f9ecf3abec6
4
+ data.tar.gz: deaf44db028b0542758c9a93ba94af49ec0f8dbd
5
5
  SHA512:
6
- metadata.gz: c9fc0216db22840d7a89b000720ab32b32b47f3215f5afbd662bc41eaf5f2bf4e7dd775bbf490b11596f3525176f5d1ead489a670effeef7386ed4951410a3ac
7
- data.tar.gz: 0d63d84d4a9a3e837cd9ef781743c09295fade9d383473a9ae5a121a3a12151999595e31e5043539b350939d973626db0e59250a66f004138bab4e4b68fbc719
6
+ metadata.gz: 6a0bd019f37aeee86328d4e30ac3d0f94503c9a92fbbaca3e8687926c0c50008c092600fd963ca7baf9e56a980d2590c1f635dcab9d81c75c7f015e3bc906f9d
7
+ data.tar.gz: dc64b7490dcbb50087842e1e1b36e926925fe619ebcaa85e88e8c930e024d6896d3b4c4536817ad64de8a5a414c39f702273baffe54f4032446f0c14f6cd90c5
@@ -1,3 +1,3 @@
1
1
  success_message('<%= @_msg || t("faalis.dashboard.create_success_msg", resource: @resource_title) %>');
2
- var target = '<%= get_url(@index_route, @engine) %>';
2
+ var target = '<%= get_url(@index_route, @resource.id, @engine) %>';
3
3
  redirect_to(target);
@@ -1,3 +1,3 @@
1
1
  success_message('<%= @_msg || t("faalis.dashboard.edit_success_msg", resource: @resource_title) %>');
2
- var target = '<%= get_url(@index_route, @engine) %>';
2
+ var target = '<%= get_url(@index_route, @resource.id, @engine) %>';
3
3
  redirect_to(target);
@@ -144,8 +144,9 @@ module Faalis::Dashboard::Sections
144
144
  f.html
145
145
  else
146
146
  flash[:success] = msg
147
-
148
- path = Rails.application.routes.url_helpers.send(@index_route)
147
+ # Engine to fetch the route from
148
+ engine = _engine || Rails.application
149
+ path = engine.routes.url_helpers.send(@index_route)
149
150
  # TODO: We really need to put setup routed on top of this method
150
151
  f.js { render "faalis/dashboard/resource/#{section}" }
151
152
  f.html { redirect_to path }
@@ -163,7 +164,9 @@ module Faalis::Dashboard::Sections
163
164
  else
164
165
  flash[:error] = msg
165
166
 
166
- path = Rails.application.routes.url_helpers.send(@index_route)
167
+ # Engine to fetch the route from
168
+ engine = _engine || Rails.application
169
+ path = engine.routes.url_helpers.send(@index_route)
167
170
  # TODO: We really need to put setup routed on top of this method
168
171
 
169
172
  f.js { render 'faalis/shared/errors' }
@@ -76,7 +76,6 @@ module Faalis::Dashboard::Sections
76
76
  before_create_hook(@resource)
77
77
 
78
78
  # TODO: Handle M2M relations in here
79
-
80
79
  if @resource.save
81
80
  successful_response(:create)
82
81
  else
@@ -110,7 +109,7 @@ module Faalis::Dashboard::Sections
110
109
  end
111
110
 
112
111
  def creation_params
113
- resource = model_name.underscore.to_sym
112
+ resource = controller_name.singularize.underscore.to_sym
114
113
 
115
114
  # TODO: replace this line with a better solution to not
116
115
  # allowing the blacklisted fields like id, created_at and ...
@@ -18,5 +18,5 @@
18
18
  # -----------------------------------------------------------------------------
19
19
 
20
20
  module Faalis
21
- VERSION = '2.0.7'
21
+ VERSION = '2.0.8'
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faalis
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.7
4
+ version: 2.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sameer Rahmani
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-03-02 00:00:00.000000000 Z
12
+ date: 2016-03-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails