Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class AssetsController < ApplicationController
- def index
- @assets = Asset.all
- end
- def create
- resource = OEmbed::Providers.get(params[:asset][:url])
- if Asset.create({
- :title => resource.title,
- :html => resource.html,
- :description => resource.description
- })
- redirect_to assets_path, :notice => "The asset was successfully saved."
- else
- render :new
- end
- end
- def new
- @asset = Asset.new
- end
- end
Add Comment
Please, Sign In to add comment