kablam 0.3.8 → 0.3.9

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: 90137a68468f91c7f4cdf8ed598b1f34c57d68ab9b5e0d5ce982a5e23a52fcd5
4
- data.tar.gz: 727d5e07d5c453614eb21455e2984e74b56d748fec81c3d59d7b74ae4135dc4f
3
+ metadata.gz: 463dcfe577a664d1d23e06712ef9ac0b37936f865a590124004b64f723ce25e5
4
+ data.tar.gz: 9fc8a0b6e8867067add020a5c647419ef1e7fc2d2783574122c57166f1301c78
5
5
  SHA512:
6
- metadata.gz: 9a01e79cb8ffdbd837a1b9c273a044972789b86686736a87c340ba5b02b39d08545a4817406efcb9a362bda1d0041a171103b046dfd07ce63136ac49fbeca8c5
7
- data.tar.gz: 7e6bbf550266f841415381904627b080f31eae4b0f38242f9f17a0b6e18143d38044e24efc9cacea7268547df42b94c2e31ce0403fbd332334f9b1973e0b5660
6
+ metadata.gz: 64760c6b91ae6b1454e8ca774bde2f086b5f7271748e9d9aa766ca8d63d44ed13dbc4d495132bae6b9c33163ccdb5ce28e169502954387e18defc422fde98e5e
7
+ data.tar.gz: e31617aca53913e79c354b5cefbd66cd91c237415386da7b803d4e083ed49008a5242b581ed88db88230b55753a4996d9cb84e2da00b8b8ed26ca3aeba0ed350
data/README.md CHANGED
@@ -1,2 +1,72 @@
1
- # kablam
2
- Kablam Ruby Gem
1
+ ![](http://bcdbimages.s3.amazonaws.com/nick/kablam.jpg)
2
+
3
+ *Documentation In Progress*
4
+ # Large Scale Automation. Small Scale Customization.
5
+ The concept of this gem is simple. And, although it goes slightly against the "Convention Over Configuration" ideal that makes Rails an **AWESOME** and powerful tool, you'll see how it makes devloping a large-scale application super easy. The concept came when styling 20-50 form fields for a really large table just drained the energy from my day.
6
+
7
+ In a nutshell, here's the idea: Reduce the amount of tedious repetative tasks that are unavoidable and must be done. Eventually, I aim to include every major *common* SAAS feature in this one gem.
8
+
9
+ There are three files you will need to work with:
10
+ <code>config/initializers/kablam.rb</code>
11
+ <code>config/locales/kablam-forms.(*LANGUAGE).yml</code>
12
+ <code>app/models/your_model.rb</code>
13
+
14
+ The Kablam Initializer contains all the standardized classes you use in your project. All the forms, the textareas, the input-texts, etc. These classes will be used by default in every form for every field, but can also be overwritten on a per-form basis.
15
+
16
+ The Kablam Locale YML will contain *ALL THE TEXT* rendered in your forms. All the placeholders, all the labels, all the hints, and all the pretexts.
17
+
18
+ In Your Model, you will be able to adjust kablams automatic rendering of forms by letting it know which columns to render in what way.
19
+
20
+ KABLAM FORMS
21
+ -------------
22
+ *insert pretext explaining forms & comparing w/ form_for and simple_form_for*
23
+
24
+ Here's an example with the Article model.
25
+ @article can be either <code>Article.new</code> or <code>Article.find(id)</code>
26
+ If @article has an id, it will render an update form, else, a new form.
27
+
28
+ Basic Use :
29
+ ```
30
+ <%= kablam_form_for @object %>
31
+ ```
32
+ This will go through all the data columns in its database table and render a field for it.
33
+ Every field is in this order:
34
+
35
+ ```
36
+ <div> <---Form Group
37
+ <div></div> <---Pretext Box (used for special notifications/descriptions)
38
+ <label></label> <---Label
39
+ <small></small> <---Hint
40
+ <input> <---Input
41
+ </div>
42
+ ```
43
+
44
+ Advanced Use:
45
+
46
+ To render special content before a field
47
+ ```
48
+ <%= kablam_form_for @object do %>
49
+ <% kablam_before("field_name") do %>
50
+ <div> something to put before "field_name" form field is rendered</div>
51
+ <% end %>
52
+ <% end %>
53
+ ```
54
+ To render special content after a field
55
+ ```
56
+ <%= kablam_form_for @object do %>
57
+ <% kablam_after("field_name") do %>
58
+ <div> something to put after "field_name" form field is rendered</div>
59
+ <% end %>
60
+ <% end %>
61
+ ```
62
+
63
+ To use form_for helpers\* (note: still needs testing):
64
+ ```
65
+ <%= kablam_form_for @object do |f| %>
66
+ <%= f.text_field :some_column, value: "a value" %>
67
+ <% end %>
68
+ ```
69
+
70
+ KABLAM MESSAGING
71
+ ----------
72
+ *To DO: Make documentation on setting up / using Kablam Messaging*
@@ -7,8 +7,8 @@
7
7
  @form_id = "#{obj.id.blank? ? "new" : "update"}_#{@form_name}_form"
8
8
  @url = (@method == :post ? Kablam::Engine.routes.url_helpers.create_path(@table_name) : Kablam::Engine.routes.url_helpers.update_path(@table_name, obj.id))
9
9
  %>
10
- <% yield %>
11
10
  <%= form_with model: obj, url: @url, method: @method, id: @form_id, class: classes[:form_wrapper], multipart: true do |f| %>
11
+ <% yield(f) %>
12
12
  <% if redirect.present? %>
13
13
  <input id="<%= @form_id %>_redirect" type="hidden" name="redirect" value="<%= redirect %>">
14
14
  <% end %>
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'kablam'
3
- s.version = '0.3.8'
3
+ s.version = '0.3.9'
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.}"
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.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Rivas