formula 1.1.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile +11 -0
- data/README.md +71 -0
- data/bin/rubocop +8 -0
- data/bin/test +5 -0
- data/lib/formula/config.rb +136 -0
- data/lib/formula/form_builder.rb +351 -0
- data/lib/formula/form_helper.rb +49 -0
- data/lib/formula/railtie.rb +3 -2
- data/lib/formula/version.rb +3 -1
- data/lib/formula.rb +12 -495
- metadata +37 -17
- data/LICENSE +0 -20
- data/README.rdoc +0 -72
- data/Rakefile +0 -32
data/README.rdoc
DELETED
@@ -1,72 +0,0 @@
|
|
1
|
-
= Formula
|
2
|
-
|
3
|
-
Formula is a Rails form helper that generates awesome markup. The project lets users create semantically beautiful forms without introducing too much syntax.
|
4
|
-
|
5
|
-
== Requirements
|
6
|
-
|
7
|
-
The gem is tested with:
|
8
|
-
|
9
|
-
* Ruby on Rails 4.1.8
|
10
|
-
* Ruby 2.1.5
|
11
|
-
* Ruby 2.0.0
|
12
|
-
* Ruby 1.9.3
|
13
|
-
* JRuby
|
14
|
-
|
15
|
-
== Installation
|
16
|
-
|
17
|
-
gem install formula
|
18
|
-
|
19
|
-
== Examples
|
20
|
-
|
21
|
-
<% formula_form_for @user do |f| %>
|
22
|
-
<%= f.input :email %>
|
23
|
-
<%= f.input :password %>
|
24
|
-
<%= f.button 'Save' %>
|
25
|
-
<% end %>
|
26
|
-
|
27
|
-
<% formula_form_for @user do |f| %>
|
28
|
-
<%= f.input :email, label: "Email:", hint: "We promise never to bother you." %>
|
29
|
-
<%= f.input :password, label: "Password:", hint: "Must be at least six characters." %>
|
30
|
-
<%= f.button 'Save' %>
|
31
|
-
<% end %>
|
32
|
-
|
33
|
-
<% formula_form_for @company do |f|
|
34
|
-
<%= f.input :url, container: { class: 'third' }, input: { class: 'fill' } %>
|
35
|
-
<%= f.input :phone, container: { class: 'third' }, input: { class: 'fill' } %>
|
36
|
-
<%= f.input :email, container: { class: 'third' }, input: { class: 'fill' } %>
|
37
|
-
<%= f.button 'Save', button: { class: 'fancy' } %>
|
38
|
-
<% end %>
|
39
|
-
|
40
|
-
<% formula_form_for @user do |f| %>
|
41
|
-
<%= f.input :email, label: "Email:" %>
|
42
|
-
<%= f.input :password, label: "Password:" %>
|
43
|
-
<%= f.input :gender, label: 'Gender:', as: :select, choices: User::GENDERS %>
|
44
|
-
<% formula_fields_for @user.payment do |payment_f| %>
|
45
|
-
<%= payment_f.input :credit_card_number, label: 'Number:' %>
|
46
|
-
<%= payment_f.input :credit_card_expiration, label: 'Expiration:' %>
|
47
|
-
<% end %>
|
48
|
-
<%= f.button 'Save', button: { class: 'fancy' } %>
|
49
|
-
<% end %>
|
50
|
-
|
51
|
-
<% formula_form_for @user do |f| %>
|
52
|
-
<%= f.block :favourite %>
|
53
|
-
<% @favourites.each do |favourite| %>
|
54
|
-
...
|
55
|
-
<% end %>
|
56
|
-
<% end %>
|
57
|
-
<%= f.button 'Save', button: { class: 'fancy' } %>
|
58
|
-
<% end %>
|
59
|
-
|
60
|
-
== Contributors
|
61
|
-
|
62
|
-
* Iliya Grushevskiy
|
63
|
-
|
64
|
-
== Status
|
65
|
-
|
66
|
-
{<img src="http://img.shields.io/gemnasium/ksylvest/formula.svg" />}[https://gemnasium.com/ksylvest/formula]
|
67
|
-
{<img src="http://img.shields.io/travis/ksylvest/formula.svg" />}[https://travis-ci.org/ksylvest/formula]
|
68
|
-
{<img src="http://img.shields.io/codeclimate/github/ksylvest/formula.svg" />}[https://codeclimate.com/github/ksylvest/formula]
|
69
|
-
|
70
|
-
== Copyright
|
71
|
-
|
72
|
-
Copyright (c) 2010 - 2014 Kevin Sylvestre. See LICENSE for details.
|
data/Rakefile
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
begin
|
2
|
-
require 'bundler/setup'
|
3
|
-
rescue LoadError
|
4
|
-
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
-
end
|
6
|
-
|
7
|
-
require 'rdoc/task'
|
8
|
-
|
9
|
-
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
-
rdoc.rdoc_dir = 'rdoc'
|
11
|
-
rdoc.title = 'Formula'
|
12
|
-
rdoc.options << '--line-numbers'
|
13
|
-
rdoc.rdoc_files.include('README.rdoc')
|
14
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
-
end
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
Bundler::GemHelper.install_tasks
|
21
|
-
|
22
|
-
require 'rake/testtask'
|
23
|
-
|
24
|
-
Rake::TestTask.new(:test) do |t|
|
25
|
-
t.libs << 'lib'
|
26
|
-
t.libs << 'test'
|
27
|
-
t.pattern = 'test/**/*_test.rb'
|
28
|
-
t.verbose = false
|
29
|
-
end
|
30
|
-
|
31
|
-
|
32
|
-
task default: :test
|