test_controller.rb
1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
class TestController < ApplicationController
def index
render :text => 'index', :layout => true
end
post_only 'post_only'
def post_only
render :text => '<span>post_only</span>'
end
def help_with_string
render :inline => '<%= help "my_help_message" %>'
end
def help_with_block
render :inline => '
<% help do %>
my_help_message
<% end %>
'
end
def help_textile_with_string
render :inline => '<%= help_textile "*my_bold_help_message*" %>'
end
def help_textile_with_block
render :inline => '
<% help_textile do %>
*my_bold_help_message*
<% end %>
'
end
def help_without_block
render :inline => '
<% help %>
'
end
require_ssl :only => 'sslonly'
def sslonly
render :text => 'this should be seen only on SSL', :layout => false
end
def doesnt_need_ssl
render :text => 'this should be seen even without SSL', :layout => false
end
refuse_ssl :only => 'nossl'
def nossl
render :text => 'this should not be seen over SSL', :layout => false
end
def doesnt_refuse_ssl
render :text => 'this should be seen over SSL or not, whatever', :layout => false
end
end