Created
March 12, 2013 11:55
-
-
Save RyanMacG/5142332 to your computer and use it in GitHub Desktop.
Add a new asset
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create | |
@asset = current_user.assets.build(params[:asset]) | |
if @asset.save | |
redirect_to root_path | |
flash.now[:success] = "Asset created!" | |
else | |
render 'static_pages/home' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment