rails-image-post-solution 0.1.20 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c709781dda3b53150943b1146480be6d6e02b05d19aef169c8ad1a4c1c44b41
4
- data.tar.gz: 7dd5b58ac9e925252154bfdf34d48a618e5d4483d911469d888810dee3d28def
3
+ metadata.gz: 35594d5a6f9cda075e583af74f9ff17aafdf598bc0eb815adbfd86c7c164f66e
4
+ data.tar.gz: 33b5f597cea3c34477866d350e3d405ee3c69194ee020e118575585684010fc7
5
5
  SHA512:
6
- metadata.gz: b0ee0eac516b61e1fef69bc18c1c77b80a9e4050337702fe9b27766b5c909dba86d924cb73db12fd74cfda083dcaf10156b7ae4abe7da15676961346c3bca5e7
7
- data.tar.gz: bf1d9b8c124994d7b7170c8aa2eecc135768078a7f3202f0d6f08a1d0970ea309f241fb5103773c8d6565f20058220f715bc16302280ed27a8e54721a901d2fe
6
+ metadata.gz: bfcad48d82a46e37f13acf454b04de447a2992e765e9eed4714ba3231a84b7b118ddc0d3cbca2b99e73463d50aae210d65a6c0437309d2cc6d23ac036982a14a
7
+ data.tar.gz: 9bf67e931816a16d3b402b4ab810f4f811e2f9b2bb857336e416a40fcd55f3038345664e3d531e75a47f708a9df43e3f38299309a60275530ec2c53e781148b6
@@ -5,8 +5,8 @@ module RailsImagePostSolution
5
5
  # Engine's base controller inherits from host application's ApplicationController
6
6
  # This allows the engine to use the host app's authentication methods
7
7
 
8
- # Prepend engine's view path
9
- prepend_view_path Engine.root.join("app", "views")
8
+ # Add engine view path before rendering
9
+ before_action :add_engine_view_path
10
10
 
11
11
  # Override require_login to use main_app routes
12
12
  def require_login
@@ -26,5 +26,18 @@ module RailsImagePostSolution
26
26
  redirect_to main_app.root_path, alert: I18n.t("errors.messages.admin_required")
27
27
  end
28
28
  end
29
+
30
+ private
31
+
32
+ def add_engine_view_path
33
+ prepend_view_path Engine.root.join("app", "views")
34
+ end
35
+
36
+ # Make main_app available as a helper
37
+ helper_method :main_app
38
+
39
+ def main_app
40
+ Rails.application.routes.url_helpers
41
+ end
29
42
  end
30
43
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsImagePostSolution
4
- VERSION = "0.1.20"
4
+ VERSION = "0.1.21"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-image-post-solution
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.20
4
+ version: 0.1.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - dhq_boiler