Class: ViewController

Inherits:
Controller show all
Defined in:
app/controllers/view_controller.rb

Instance Attribute Summary

Attributes inherited from Controller

#app, #view_private

Instance Method Summary collapse

Methods inherited from Controller

#add_private_action, #e, #get, #initialize

Constructor Details

This class inherits a constructor from Controller

Instance Method Details

#create(view) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'app/controllers/view_controller.rb', line 12

def create(view)
	if @app.config['server']['Security']['VisualErrors']
		contents = <<-eos
<br /><br />
<div class="container">
<div class="row">
	<div class="span12">
		<h1>#{view}</h1>
		<p>This view is simply a placeholder for something amazing! You can edit the view here:</p>
		<pre><code>app/views/#{view}.erb</code></pre>
	</div>
</div>
</div>
		eos

		File.write "app/views/#{view}.erb", contents

		get('controller', 'Home').index
	end
end