public
Description: All the extra stuff you could want for the Mack Framework.
Homepage: http://www.mackframework.com
Clone URL: git://github.com/markbates/mack-more.git
mack-more / mack-distributed / spec / fake_application / app / controllers / vtt / view_template_controller.rb
100644 103 lines (78 sloc) 2.762 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
class Vtt::ViewTemplateController
  include Mack::Controller
  
  def bart_html_erb_with_layout
    render(:action, "bart")
  end
  
  def bart_html_erb_with_special_layout
    render(:action, "bart", :layout => "my_cool")
  end
  
  def bart_html_erb_without_layout
    render(:action, "bart", :layout => false)
  end
    
  def lisa_inline_erb_with_layout
    render(:inline, %{Lisa <%= "Simpson" %>: INLINE, ERB})
  end
  
  def lisa_inline_erb_with_special_layout
    render(:inline, %{Lisa <%= "Simpson" %>: INLINE, ERB}, :layout => "my_cool")
  end
  
  def lisa_inline_erb_without_layout
    render(:inline, %{Lisa <%= "Simpson" %>: INLINE, ERB}, :layout => false)
  end
  
  def homer_xml_with_layout
    render(:xml, "homer")
    @name = "Homer Simpson"
  end
  
  def homer_xml_without_layout
    @name = "Homer Simpson"
    render(:xml, "homer", :layout => false)
  end
  
  def homer_xml_with_special_layout
    @name = "Homer Simpson"
    render(:xml, "homer", :layout => "my_cool")
  end
  
  def good_get_url
    render(:url, "http://testing.mackframework.com/render_url_get_test.php", :parameters => {:age => 31})
  end
  
  def bad_get_url
    render(:url, "http://testing.mackframework.com/i_dont_exist.html", :parameters => {:age => 31})
  end
  
  def bad_with_raise_url
    render(:url, "http://testing.mackframework.com/i_dont_exist.html", :raise_exception => true, :parameters => {:age => 31})
  end
  
  def good_post_url
    render(:url, "http://testing.mackframework.com/render_url_post_test.php", :method => :post, :parameters => {:age => 31})
  end
  
  def bad_post_url
    render(:url, "http://testing.mackframework.com/i_dont_exist.php", :method => :post, :parameters => {:age => 31})
  end
  
  def bad_post_with_raise_url
    render(:url, "http://testing.mackframework.com/i_dont_exist.php", :raise_exception => true, :method => :post, :parameters => {:age => 31})
  end
  
  def good_put_url
    render(:url, "http://testing.mackframework.com/render_url_post_test.php", :method => :put, :parameters => {:age => 31})
  end
  
  def good_delete_url
    render(:url, "http://testing.mackframework.com/render_url_post_test.php", :method => :delete, :parameters => {:age => 31})
  end
  
  def say_hi
    render(:text, "Hello", :layout => false)
  end
  
  def public_found
    render(:public, "vtt_public_test")
  end
  
  def public_not_found
    render(:public, "vtt_public_not_found_test")
  end
  
  def public_found_nested
    render(:public, "vtt/vtt_public_nested_test")
  end
  
  def public_with_extension
    render(:public, 'vtt/vtt_public_with_extension_test.txt')
  end
  
  def partial_local
    render(:partial, :local_part)
  end
  
  def partial_outside
    render(:partial, "application/outside_part")
  end
  
end