To make this work in CSS:
background: url('images.svg#chart');or img:
<img src="images.svg#chart">To make this work in CSS:
background: url('images.svg#chart');or img:
<img src="images.svg#chart">| class ApplicationController < ActionController::Base | |
| include EtagWithLayout | |
| end |
| import PureRenderMixin from 'react-addons-pure-render-mixin'; | |
| import React from 'react'; | |
| import Audio from './Audio'; | |
| import Image from './Image'; | |
| import MediaRecord from 'ph/records/MediaRecord'; | |
| import PostRecord from 'ph/records/PostRecord'; | |
| import Video from './Video'; | |
| import {MEDIA_TYPE_AUDIO, MEDIA_TYPE_IMAGE, MEDIA_TYPE_VIDEO} from 'ph/constants/MediaConstants'; |
| # Single object | |
| <%= render partial: 'thumbnail', object: video, as: :video %> | |
| <%= render partial: 'thumbnail', locals: { video: video } %> | |
| <%= render 'thumbnail', video: video %> | |
| # Collection | |
| <%= render partial: 'thumbnail', collection: videos, as: :video %> |
| module Taggable | |
| extend ActiveSupport::Concern | |
| included do | |
| attr_accessible :tags | |
| after_save :set_tags | |
| after_destroy :unset_tags | |
| end |
| class Duration | |
| attr_accessor :duration | |
| def initialize(string) | |
| @duration = string | |
| end | |
| def to_i | |
| value_units.map(&:to_i).reduce(&:+) | |
| end |
| class Card | |
| constructor: (selector) -> | |
| @$container = $('.cards') | |
| @$element = @$container.find(selector) | |
| @$text = @$element.find('.card-menu li:first-child a span') | |
| toggleClass: -> | |
| @$element.toggleClass('is-favorited') | |
| changeText: -> | |
| cardText = if @$element.favorited then 'Unfavorite' else 'Favorite' | |
| @$text.text(cardText) |
| twfbCounters = -> | |
| $twitterFacebook = $('#twfb') | |
| $.ajax { | |
| url: 'http://api.twitter.com/1/users/show.json', | |
| data: 'screen_name=zeptojs', | |
| dataType: 'jsonp' | |
| success: (data, status, xhr) -> | |
| $twitterFacebook.html(data.followers_count) | |
| error: (xhr, errorType, error) -> |
| @error = :invalid_type and return if (type = params[:type]) and (type != :iphone && type != :android) | |
| # exactly the same as: (if prefer the former) | |
| if type = params[:type] and (type != :iphone && type != :android) | |
| @error = :invalid_type | |
| return | |
| end | |
| # or |