Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| require "rubygems" | |
| require 'sinatra' | |
| require "aws/s3" | |
| get '/' do | |
| return %Q{ | |
| <form action="upload" method="post" accept-charset="utf-8" enctype="multipart/form-data"> | |
| <div> | |
| <input type="file" name="file" value="" id="file"> | |
| </div> |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
The normal controller/view flow is to display a view template corresponding to the current controller action, but sometimes we want to change that. We use render in a controller when we want to respond within the current request, and redirect_to when we want to spawn a new request.
The render method is very overloaded in Rails. Most developers encounter it within the view template, using render :partial => 'form' or render @post.comments, but here we'll focus on usage within the controller.