Class: ViewController
- Inherits:
-
Controller
- Object
- Controller
- ViewController
- Defined in:
- app/controllers/view_controller.rb
Instance Attribute Summary
Attributes inherited from Controller
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 = "<br /><br />\n<div class=\"container\">\n<div class=\"row\">\n <div class=\"span12\">\n <h1>\#{view}</h1>\n <p>This view is simply a placeholder for something amazing! You can edit the view here:</p>\n <pre><code>app/views/\#{view}.erb</code></pre>\n </div>\n</div>\n</div>\n eos\n\n File.write \"app/views/\#{view}.erb\", contents\n\n get('controller', 'Home').index\n end\nend\n" |