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 +4 -4
- data/README.md +72 -2
- data/app/views/kablam_forms/_form_generator.html.erb +1 -1
- data/kablam.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 463dcfe577a664d1d23e06712ef9ac0b37936f865a590124004b64f723ce25e5
|
4
|
+
data.tar.gz: 9fc8a0b6e8867067add020a5c647419ef1e7fc2d2783574122c57166f1301c78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64760c6b91ae6b1454e8ca774bde2f086b5f7271748e9d9aa766ca8d63d44ed13dbc4d495132bae6b9c33163ccdb5ce28e169502954387e18defc422fde98e5e
|
7
|
+
data.tar.gz: e31617aca53913e79c354b5cefbd66cd91c237415386da7b803d4e083ed49008a5242b581ed88db88230b55753a4996d9cb84e2da00b8b8ed26ca3aeba0ed350
|
data/README.md
CHANGED
@@ -1,2 +1,72 @@
|
|
1
|
-
|
2
|
-
|
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 %>
|
data/kablam.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'kablam'
|
3
|
-
s.version = '0.3.
|
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.}"
|