Skip to content

Commit 9fd717f

Browse files
committed
fixed typo
1 parent 6ef1821 commit 9fd717f

File tree

4 files changed

+61
-5
lines changed

4 files changed

+61
-5
lines changed

docs/components/form.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ModelFormTestController < ApplicationController
4444
render json: {
4545
message: 'server says: something went wrong!',
4646
errors: @test_model.errors
47-
}, status: :unproccessable_entity
47+
}, status: :unprocessable_entity
4848
else
4949
render json: {
5050
message: 'server says: form submitted successfully!'
@@ -308,7 +308,7 @@ def model_submit
308308
render json: {
309309
message: 'server says: something went wrong!',
310310
errors: @test_model.errors
311-
}, status: :unproccessable_entity
311+
}, status: :unprocessable_entity
312312
else
313313
render json: {
314314
message: 'server says: form submitted successfully!',

spec/dummy/app/controllers/my_app_controller.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def form_action
4444
render json: {
4545
errors: @dummy_model.errors,
4646
message: "Test Model could not be saved!"
47-
}, status: :unproccessable_entity
47+
}, status: :unprocessable_entity
4848
else
4949
broadcast "test_model_created"
5050
render json: @dummy_model, status: :created
@@ -58,7 +58,7 @@ def inline_form_action
5858
render json: {
5959
errors: @dummy_model.errors,
6060
message: "Test Model could not be saved!"
61-
}, status: :unproccessable_entity
61+
}, status: :unprocessable_entity
6262
else
6363
broadcast "test_model_created"
6464
render json: @dummy_model, status: :created
@@ -74,7 +74,7 @@ def delete_dummy_model
7474
render json: {
7575
errors: @dummy_model.errors,
7676
message: "Test Model could not be deleted!"
77-
}, status: :unproccessable_entity
77+
}, status: :unprocessable_entity
7878
end
7979

8080
end
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
class Pages::MyApp::CreateAndShow < Matestack::Ui::Page
2+
3+
def prepare
4+
@dummy_model = DummyModel.new
5+
end
6+
7+
def response
8+
components {
9+
heading size: 2, text: "Create"
10+
11+
heading size: 3, text: "Dummy Model Form:"
12+
13+
form my_form_config, :include do
14+
form_input key: :title, type: :text, placeholder: "title"
15+
br
16+
br
17+
form_submit do
18+
button text: "Submit me!"
19+
end
20+
end
21+
22+
}
23+
end
24+
25+
def my_form_config
26+
{
27+
for: @dummy_model,
28+
method: :post,
29+
path: :form_action_path,
30+
success: {
31+
transition: {
32+
follow_response: true
33+
}
34+
},
35+
failure: {
36+
emit: "form_has_errors"
37+
}
38+
}
39+
end
40+
41+
end
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class Pages::MyApp::Show < Matestack::Ui::Page
2+
3+
def prepare
4+
@dummy_model = DummyModel.find context[:params][:id]
5+
end
6+
7+
def response
8+
components {
9+
heading size: 2, text: "Show"
10+
11+
plain @dummy_model.inspect
12+
}
13+
end
14+
15+
end

0 commit comments

Comments
 (0)