Skip to content

Instantly share code, notes, and snippets.

@RyanMacG
Created March 12, 2013 11:55
Show Gist options
  • Save RyanMacG/5142332 to your computer and use it in GitHub Desktop.
Save RyanMacG/5142332 to your computer and use it in GitHub Desktop.
Add a new asset
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