simple_form-magic_submit 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -3
- data/lib/simple_form/magic_submit/version.rb +1 -1
- data/lib/simple_form/magic_submit.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -24,7 +24,7 @@ When something goes wrong and the model fails validation:
|
|
24
24
|
And all this and a bit more with just a single line of code:
|
25
25
|
|
26
26
|
```haml
|
27
|
-
= f.button :
|
27
|
+
= f.button :magic_submit, cancel: root_path
|
28
28
|
```
|
29
29
|
|
30
30
|
## Installation
|
@@ -51,7 +51,7 @@ In your view template add it allong the lines of:
|
|
51
51
|
.form-inputs
|
52
52
|
= f.input :email, autofocus: true
|
53
53
|
.form-actions
|
54
|
-
= f.button :
|
54
|
+
= f.button :magic_submit
|
55
55
|
```
|
56
56
|
|
57
57
|
The last one is this gem's magic.
|
@@ -64,7 +64,7 @@ To add a cancel link:
|
|
64
64
|
.form-inputs
|
65
65
|
= f.input :email, autofocus: true
|
66
66
|
.form-actions
|
67
|
-
= f.button :
|
67
|
+
= f.button :magic_submit, cancel: root_path
|
68
68
|
```
|
69
69
|
|
70
70
|
Replace `root_path` with whatever path is relevant for your app.
|
@@ -3,7 +3,7 @@ require "simple_form/magic_submit/version"
|
|
3
3
|
module SimpleForm
|
4
4
|
module MagicSubmit
|
5
5
|
|
6
|
-
def
|
6
|
+
def magic_submit_button(*args, &block)
|
7
7
|
options = args.extract_options!
|
8
8
|
options[:data] ||= {}
|
9
9
|
options[:data][:disable_with] ||= translate_key(:disable_with)
|