inertia_rails 1.7.1 → 1.8.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
  SHA256:
3
- metadata.gz: f3300d5a0d8ba1a4a433151b232dc06a2fbbdc337f8c1948b6a1fd52dbc20b4d
4
- data.tar.gz: 3a62632643c8761c00fe3b462f2710d094a9adb06df0d7942b516c669eec7515
3
+ metadata.gz: 0c9c8c3b0d07a467179b741d6ce1f9d79d6190f0c71ecbe3e960536929055caf
4
+ data.tar.gz: 2f0f3a5ac49480f5fae1b28c771fe7bc3ea6de2953c734e0015b617fcc70a8bc
5
5
  SHA512:
6
- metadata.gz: 29d82e990a312f2392f14b209c10d6cb198d1f335d0b0e33b2d6821d8bcbc51adeb6d489362fbf2f124bc0b3605d152eb8470221c061eaf6dcae5083f5e86a79
7
- data.tar.gz: 44565a5b1b36086a7baf965671fd09d5b1e75f3ed393c7de459e5a3c4a7a2d17bd5f485f0f9b68261631cd47cd371439357cd1a852ed2d6a82aa71268c51aaf8
6
+ metadata.gz: d696ea9c18535afb527dfead16bd271613d2bb561936ffd470e85caf78e20138109c6247d2e21724751a94acafc5548849533e50da3774d510528ed6f1221bc4
7
+ data.tar.gz: 6aa06ca052045c5f27c8f1a801889cf26ed77bb5e660875e6fe74cd3c7a30eab7c306385b9707842c8a52a8131c797405741a5f34e5397a64b58da2e98c5ae62
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.8.0] - 2020-12-08
8
+
9
+ * Add `inertia` route helper feature
10
+
7
11
  ## [1.7.1] - 2020-11-24
8
12
 
9
13
  * Fix the definition for InertiaRails::Lazy to avoid an uninitialized constant error when booting an application.
@@ -0,0 +1,7 @@
1
+ module InertiaRails
2
+ class StaticController < ::ApplicationController
3
+ def static
4
+ render inertia: params[:component]
5
+ end
6
+ end
7
+ end
@@ -4,6 +4,7 @@ require 'inertia_rails/engine'
4
4
  require 'patches/debug_exceptions'
5
5
  require 'patches/better_errors'
6
6
  require 'patches/request'
7
+ require 'patches/mapper'
7
8
 
8
9
  ActionController::Renderers.add :inertia do |component, options|
9
10
  InertiaRails::Renderer.new(
@@ -1,3 +1,3 @@
1
1
  module InertiaRails
2
- VERSION = "1.7.1"
2
+ VERSION = "1.8.0"
3
3
  end
@@ -0,0 +1,8 @@
1
+ ActionDispatch::Routing::Mapper.class_eval do
2
+ def inertia(args, &block)
3
+ route = args.keys.first
4
+ component = args.values.first
5
+
6
+ get(route => 'inertia_rails/static#static', defaults: {component: component})
7
+ end
8
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inertia_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Knoles
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2020-11-24 00:00:00.000000000 Z
13
+ date: 2020-12-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -129,6 +129,7 @@ files:
129
129
  - LICENSE.txt
130
130
  - README.md
131
131
  - Rakefile
132
+ - app/controllers/inertia_rails/static_controller.rb
132
133
  - app/views/inertia.html.erb
133
134
  - bin/console
134
135
  - bin/setup
@@ -150,6 +151,7 @@ files:
150
151
  - lib/patches/debug_exceptions.rb
151
152
  - lib/patches/debug_exceptions/patch-5-0.rb
152
153
  - lib/patches/debug_exceptions/patch-5-1.rb
154
+ - lib/patches/mapper.rb
153
155
  - lib/patches/request.rb
154
156
  homepage: https://github.com/inertiajs/inertia-rails
155
157
  licenses: