kablam 0.3.6 → 0.3.7

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: 844e20a6b77e991b17e78586160b713b57134f5f0cef806bebe1077415f24d5e
4
- data.tar.gz: 17bc14cc1eb940e97d0d0f1c5bae1e16b02eaebd0b93095c7de119583685a7f5
3
+ metadata.gz: b338c47800ce82600d8559c6bc669b20a63d197f950fe0a4b6b15800d2d4ddbe
4
+ data.tar.gz: '09e87e1aad2e3f350aca2f96735f1f22d52acb878340b03299a7905f3e847f27'
5
5
  SHA512:
6
- metadata.gz: 27dd4f187625cf129af98e99863db3aa8750031627da7dcedf3d5d16051b224caa6b8d2b808ef1002bccbbfde8e8e6360a3c9baf30b4fc3d4fb3e2b59ee642ef
7
- data.tar.gz: 9ce64047a88ce76de4cd473f57770e1579c57d32ed1cbf69c9c3f27d0f44d383977b71aaaab32502d8f0f9ea0b096360d5bbe8d9124df24dd610c28bc69655df
6
+ metadata.gz: 56ad6fe5c806be4ccc6815474d63fb541e3447e7557baf8124487137e3c1e78d49fce7cf1e53a0af85d39c71913ac572d6b8fd701216d14951ef5377ba03b831
7
+ data.tar.gz: 2d31c6164b666c7b2a937d8dcdb96c4bceafac494c7e60aad323168df3158d622858d7fffc907c55ca1fd467482f1fa872938f335fc7cd4620cec540c6de1df5
@@ -4,9 +4,9 @@ var newMessage = HTMLElement.From(content);
4
4
  var target = document
5
5
  .getElementById('<%= params[:target] || "target_index" %>')
6
6
 
7
- <% if Kablam.render_item["#{@object.class.table_name}"] == "top" %>
7
+ <% if Kablam.render_item["#{@object.model_name.singular}"] == "top" %>
8
8
  target.innerHTML = newMessage.outerHTML + target.innerHTML;
9
- <% elsif Kablam.render_item["#{@object.class.table_name}"] == "bottom" %>
9
+ <% elsif Kablam.render_item["#{@object.model_name.singular}"] == "bottom" %>
10
10
  target.innerHTML = target.innerHTML + newMessage.outerHTML;
11
11
  <% end %>
12
12
 
@@ -30,6 +30,9 @@
30
30
  <%= (render "kablam_forms/fields/pretext", classes: classes, input: input) if input[:pretext].present? %>
31
31
  <%= render "kablam_forms/fields/#{classyy.to_s}", classes: classes, input: input, f: f, opt: opt %>
32
32
  <% end %>
33
+ <div>
34
+ <%= yield(f) %>
35
+ </div>
33
36
  <%= f.submit(
34
37
  data: { disable_with: 'Submitting' },
35
38
  class: classes[:submit_button]) %>
@@ -10,9 +10,7 @@
10
10
  redirect = redirect || nil
11
11
  scrolltop = scrolltop || false
12
12
  %>
13
-
14
- <%= render "kablam_forms/form_generator", classes: classes, obj: obj, target: target, hidden: hidden, ajax_remove: ajax_remove, redirect: redirect, scrolltop: scrolltop %>
15
-
16
-
17
-
13
+ <%= render "kablam_forms/form_generator", classes: classes, obj: obj, target: target, hidden: hidden, ajax_remove: ajax_remove, redirect: redirect, scrolltop: scrolltop do |f| %>
14
+ <%= yield(f) %>
15
+ <% end %>
18
16
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'kablam'
3
- s.version = '0.3.6'
3
+ s.version = '0.3.7'
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.}"
@@ -9,6 +9,13 @@ module Kablam
9
9
  polymorphic_path("data_undo", params)
10
10
  end
11
11
 
12
+ def kablam_form_for(obj, options = {}, &block)
13
+ options[:obj] = obj
14
+ render layout: "kablam_forms/kablam_form", locals: options do
15
+ capture(&block) if block_given?
16
+ end
17
+ end
18
+
12
19
  # TODO: Complete this 🤷
13
20
  def disable_test
14
21
  'console.log("test")'
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.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Rivas