Skip to content

Commit c71bb5d

Browse files
committed
Add example to slack modal for new puzzle
1 parent be293d1 commit c71bb5d

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

app/lib/slack_client/views/puzzle_form.rb

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@ def create
88
end
99

1010
blocks.input label: "What is the Puzzle question?", block_id: "question" do |input|
11-
input.plain_text_input action_id: "question", multiline: true
11+
input.plain_text_input(
12+
action_id: "question",
13+
multiline: true,
14+
placeholder: "See template below"
15+
)
16+
end
17+
18+
blocks.context do |context|
19+
context.mrkdwn text: "*Puzzle Examples*"
20+
context.plain_text text: placeholder_text
1221
end
1322

1423
blocks.input label: "Answer", block_id: "answer" do |input|
@@ -42,6 +51,25 @@ def intro_text
4251
When providing the question, please provide ONLY the question text, without any additional introduction (for example, do not include "Is this ruby or rails?"). The bot will add that automatically.
4352
TEXT
4453
end
54+
55+
def placeholder_text
56+
<<~TEXT
57+
58+
Example: Multi-line Snippet
59+
60+
In this snippet:
61+
62+
```
63+
Time.current.strftime("%Y-%m-%dT%H:%M:%S%z")
64+
```
65+
66+
Is the `current` method a Ruby or Rails method?
67+
68+
Example: Single Sentence Snippet
69+
70+
When you have a line like this `hash = { a: 1, b: 2, c: 3 }` and later you call this method `hash.transform_keys(&:to_s)` -- is `transform_keys` a Ruby or Rails method?
71+
TEXT
72+
end
4573
end
4674
end
4775
end

0 commit comments

Comments
 (0)