cache_if

cache_if(condition, name = {}, options = nil, &block) Instance Public methods Cache fragments of a view if condition is true <%= cache_if admin?, project do %> <b>All the topics on this project</b> <%= render project.topics %> <% end %>

cache_fragment_name

cache_fragment_name(name = {}, options = nil) Instance Public methods This helper returns the name of a cache key for a given fragment cache call. By supplying skip_digest: true to cache, the digestion of cache fragments can be manually bypassed. This is useful when cache fragments cannot be manually expired unless you know the exact key which is the case when using memcached.

cache

cache(name = {}, options = nil, &block) Instance Public methods This helper exposes a method for caching fragments of a view rather than an entire action or page. This technique is useful caching pieces like menus, lists of new topics, static HTML fragments, and so on. This method takes a block that contains the content you wish to cache. The best way to use this is by doing key-based cache expiration on top of a cache store like Memcached that'll automatically kick out old ent

atom_feed

atom_feed(options = {}, &block) Instance Public methods Adds easy defaults to writing Atom feeds with the Builder template engine (this does not work on ERB or any other template languages). Full usage example: config/routes.rb: Rails.application.routes.draw do resources :posts root to: "posts#index" end app/controllers/posts_controller.rb: class PostsController < ApplicationController::Base # GET /posts.html # GET /posts.atom def index @post

video_url

video_url(source, options = {}) Instance Public methods Computes the full URL to a video asset in the public videos directory. This will use video_path internally, so most of their behaviors will be the same. url_to_video

video_path

video_path(source, options = {}) Instance Public methods Computes the path to a video asset in the public videos directory. Full paths from the document root will be passed through. Used internally by video_tag to build the video path. video_path("hd") # => /videos/hd video_path("hd.avi") # => /videos/hd.avi video_path("trailers/hd.avi") # => /videos/trailers/hd.

url_to_video

url_to_video(source, options = {}) Instance Public methods Alias for: video_url

url_to_stylesheet

url_to_stylesheet(source, options = {}) Instance Public methods Alias for: stylesheet_url

url_to_javascript

url_to_javascript(source, options = {}) Instance Public methods Alias for: javascript_url

url_to_image

url_to_image(source, options = {}) Instance Public methods Alias for: image_url