kablam 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/kablam_controller.rb +1 -1
- data/app/views/kablam/create.js.erb +2 -0
- data/app/views/kablam_forms/_form_generator.html.erb +1 -0
- data/kablam.gemspec +1 -1
- data/lib/generators/kablam/forms_generator.rb +4 -2
- data/lib/kablam.rb +1 -0
- data/lib/kablam/kablam_helper.rb +31 -0
- data/lib/kablam/kablam_record.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 865d1eb66fbbd162bef912ea6b41c1781898bfc2df16f74730f47f949668fb4a
|
4
|
+
data.tar.gz: 27ffd407b3e5777ca66fddb72b3246c78eaad8d71b8c354871437fb27b9e7b0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87d808b09665716042463d28319ed53f17192afc847d115ac2202f3ed6ad3c88da0cb82ae910b0a497cf04c3f18751c3953a61e037e3142a0dc9e081f336ff9a
|
7
|
+
data.tar.gz: 9c4c9e40349582a48d398b9f2432af1ec3857359485f8dc36017eaaddf37e3eb86f2e9d17003ab9417ea756481f250ae62ad3adaad88cdf0c88d32ab2fe04382
|
@@ -1,3 +1,4 @@
|
|
1
|
+
<% if params[:target].present? %>
|
1
2
|
var content = `<%= j render "kablam/models/#{@object.model_name.singular}", obj: @object %>`
|
2
3
|
|
3
4
|
document
|
@@ -7,4 +8,5 @@ document
|
|
7
8
|
document
|
8
9
|
.querySelector('[action$="/<%= params[:target] || "target_index" %>"]')
|
9
10
|
.reset()
|
11
|
+
<% end %>
|
10
12
|
<%= render_flash message: 'Created' %>
|
data/kablam.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'kablam'
|
3
|
-
s.version = '0.2.
|
3
|
+
s.version = '0.2.8'
|
4
4
|
s.date = Time.now.strftime("%Y-%m-%d")
|
5
5
|
s.summary = "Kablam! All the things you hate. But Faster."
|
6
6
|
s.description = "Gem to make development of everything in rails faster. Form creation & styling, all the resource routes, even actioncable messaging!\n {NOTE: In Development. NOT READY FOR TESTING.}"
|
@@ -75,9 +75,11 @@ module Kablam
|
|
75
75
|
|
76
76
|
def gen_yaml(db_index)
|
77
77
|
path = "config/locales/kablam-forms.#{name}.yml"
|
78
|
-
original = YAML.load_file(path)
|
79
78
|
yml_hash = {name => {"kablam_forms" => db_to_hash(db_index)}}
|
80
|
-
|
79
|
+
if File.exist?(Rails.root.to_s + "/"+ path)
|
80
|
+
original = YAML.load_file(path)
|
81
|
+
yml_hash.merge!(original) if original.present?
|
82
|
+
end
|
81
83
|
|
82
84
|
File.write(path, yml_hash.to_yaml)
|
83
85
|
dump_yaml_with_double_quotes(path)
|
data/lib/kablam.rb
CHANGED
@@ -0,0 +1,31 @@
|
|
1
|
+
module Kablam
|
2
|
+
module KablamHelper
|
3
|
+
def replace_with(id, content)
|
4
|
+
end
|
5
|
+
|
6
|
+
def undo_destroy_path(model)
|
7
|
+
name = model.model_name.singular
|
8
|
+
params = [[name, { destroyed_at: nil }]].to_h
|
9
|
+
polymorphic_path("data_undo", params)
|
10
|
+
end
|
11
|
+
|
12
|
+
# TODO: Complete this 🤷
|
13
|
+
def disable_test
|
14
|
+
'console.log("test")'
|
15
|
+
end
|
16
|
+
|
17
|
+
# TODO: Use Rails UJS setData/expando to stash original state 😎
|
18
|
+
def show(model)
|
19
|
+
raw "document.getElementById('#{model.html_id}').style.display = 'table-row'"
|
20
|
+
end
|
21
|
+
|
22
|
+
def hide(model)
|
23
|
+
raw "document.getElementById('#{model.html_id}').style.display = 'none'"
|
24
|
+
end
|
25
|
+
|
26
|
+
def render_flash(partial: 'application/flash_notice', **locals)
|
27
|
+
html = j render partial: partial, locals: locals
|
28
|
+
raw "document.getElementById('flash').innerHTML = '#{html}'"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/kablam/kablam_record.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kablam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergio Rivas
|
@@ -110,6 +110,7 @@ files:
|
|
110
110
|
- lib/kablam.rb
|
111
111
|
- lib/kablam/engine.rb
|
112
112
|
- lib/kablam/forms.rb
|
113
|
+
- lib/kablam/kablam_helper.rb
|
113
114
|
- lib/kablam/kablam_record.rb
|
114
115
|
homepage: http://rubygems.org/gems/kablam
|
115
116
|
licenses:
|