🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

refinerycms-vimeo-videos

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

refinerycms-vimeo-videos

bundlerRubygems
Version
0.2.rc2
Version published
Maintainers
1
Created
Source

Refinerycms-Vimeo-Videos

This gem makes it easy for refinerycms sites to add vimeo videos to models. It is still in a very experimental phase of development, but already used in production. Use only if you are sure about what the code does.

Setup and Authorization

Add the gem to your Gemfile and bundle install it

gem 'refinerycms-vimeo-videos'

Run the generator and migrate your database

rails generate refinerycms_vimeo_videos
rake db:migrate

Create an api-application for your vimeo account under http://vimeo.com/api/applications with a callback url of

http://yourapp.com/refinery/vimeo_videos/callback

Copy/paste the consumer_key and consumer_secret of your vimeo api-application to the related Refinery Settings (:vimeo_consumer_key and :vimeo_consumer_secret). Then access the following url:

http://yourapp.com/refinery/vimeo_videos/authorization

After this, your app should be setup to use your vimeo account.

Adding a vimeo video

Add a field to the table:

add_column :projects, :test_video_id, :string

Call vimeo_video in your model with the corresponding field as attribute:

vimeo_video :test_video

In your _form.html.erb insert this:

<div class='field'>
  <%= f.label "Test Video" -%>
  <%= render :partial => "/refinery/admin/vimeo_picker", :locals => {
        :f => f,
        :field => :test_video_id,
        :vimeo_video => @project.test_video
      } %>
</div>

Now embed the video (with a width of 750px):

<%= @project.test_video.embed '750' -%>

Invalidating Caches

If you need to invalidate the whole cache, simply call delete_all on VimeoEmbedCache and VimeoMetaCache.

In case you want to just pull in changes, you can do:

VimeoEmbedCache.update_cache
VimeoMetaCache.update_cache

TODO

Alot!

FAQs

Package last updated on 05 Oct 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts