Adds title and description where needed.
This commit is contained in:
parent
fde9504847
commit
5a0bc2c7bc
|
@ -8,11 +8,13 @@ module ActionView #:nodoc:
|
|||
class NonConcattingString < ActiveSupport::SafeBuffer
|
||||
end
|
||||
|
||||
# = Action View Base
|
||||
#
|
||||
# Action View templates can be written in three ways. If the template file has a <tt>.erb</tt> (or <tt>.rhtml</tt>) extension then it uses a mixture of ERb
|
||||
# (included in Ruby) and HTML. If the template file has a <tt>.builder</tt> (or <tt>.rxml</tt>) extension then Jim Weirich's Builder::XmlMarkup library is used.
|
||||
# If the template file has a <tt>.rjs</tt> extension then it will use ActionView::Helpers::PrototypeHelper::JavaScriptGenerator.
|
||||
#
|
||||
# = ERb
|
||||
# == ERb
|
||||
#
|
||||
# You trigger ERb by using embeddings such as <% %>, <% -%>, and <%= %>. The <%= %> tag set is used when you want output. Consider the
|
||||
# following loop for names:
|
||||
|
@ -32,7 +34,7 @@ module ActionView #:nodoc:
|
|||
#
|
||||
# <%- and -%> suppress leading and trailing whitespace, including the trailing newline, and can be used interchangeably with <% and %>.
|
||||
#
|
||||
# == Using sub templates
|
||||
# === Using sub templates
|
||||
#
|
||||
# Using sub templates allows you to sidestep tedious replication and extract common display structures in shared templates. The
|
||||
# classic example is the use of a header and footer (even though the Action Pack-way would be to use Layouts):
|
||||
|
@ -54,7 +56,7 @@ module ActionView #:nodoc:
|
|||
#
|
||||
# <title><%= @page_title %></title>
|
||||
#
|
||||
# == Passing local variables to sub templates
|
||||
# === Passing local variables to sub templates
|
||||
#
|
||||
# You can pass local variables to sub templates by using a hash with the variable names as keys and the objects as values:
|
||||
#
|
||||
|
@ -74,7 +76,7 @@ module ActionView #:nodoc:
|
|||
#
|
||||
# Testing using <tt>defined? headline</tt> will not work. This is an implementation restriction.
|
||||
#
|
||||
# == Template caching
|
||||
# === Template caching
|
||||
#
|
||||
# By default, Rails will compile each template to a method in order to render it. When you alter a template, Rails will
|
||||
# check the file's modification time and recompile it.
|
||||
|
|
|
@ -2,13 +2,12 @@ module ActionView
|
|||
module CompiledTemplates #:nodoc:
|
||||
# holds compiled template code
|
||||
end
|
||||
|
||||
# Action View contexts are supplied to Action Controller
|
||||
# to render template. The default Action View context
|
||||
# is ActionView::Base.
|
||||
# = Action View Context
|
||||
#
|
||||
# In order to work with ActionController, a Context
|
||||
# must implement:
|
||||
# Action View contexts are supplied to Action Controller to render template.
|
||||
# The default Action View context is ActionView::Base.
|
||||
#
|
||||
# In order to work with ActionController, a Context must implement:
|
||||
#
|
||||
# Context#render_partial[options]
|
||||
# - responsible for setting options[:_template]
|
||||
|
@ -21,16 +20,14 @@ module ActionView
|
|||
# options<Hash>:: See _render_template_with_layout in ActionView::Base
|
||||
# partial<Boolean>:: Whether or not the template to render is a partial
|
||||
#
|
||||
# An Action View context can also mix in Action View's
|
||||
# helpers. In order to mix in helpers, a context must
|
||||
# implement:
|
||||
# An Action View context can also mix in Action View's helpers. In order to
|
||||
# mix in helpers, a context must implement:
|
||||
#
|
||||
# Context#controller
|
||||
# - Returns an instance of AbstractController
|
||||
#
|
||||
# In any case, a context must mix in ActionView::Context,
|
||||
# which stores compiled template and provides the output
|
||||
# buffer.
|
||||
# In any case, a context must mix in ActionView::Context, which stores compiled
|
||||
# template and provides the output buffer.
|
||||
module Context
|
||||
include CompiledTemplates
|
||||
attr_accessor :output_buffer
|
||||
|
|
|
@ -6,6 +6,7 @@ require 'active_support/core_ext/file'
|
|||
require 'active_support/core_ext/object/blank'
|
||||
|
||||
module ActionView
|
||||
# = Action View Asset Tag Helpers
|
||||
module Helpers #:nodoc:
|
||||
# This module provides methods for generating HTML that links views to assets such
|
||||
# as images, javascripts, stylesheets, and feeds. These methods do not verify
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
require 'set'
|
||||
|
||||
# Adds easy defaults to writing Atom feeds with the Builder template engine (this does not work on ERb or any other
|
||||
# template languages).
|
||||
module ActionView
|
||||
# = Action View Atom Feed Helpers
|
||||
module Helpers #:nodoc:
|
||||
module AtomFeedHelper
|
||||
# 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:
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
module ActionView
|
||||
# = Action View Cache Helper
|
||||
module Helpers
|
||||
# This helper to exposes a method for caching of view fragments.
|
||||
# See ActionController::Caching::Fragments for usage instructions.
|
||||
module CacheHelper
|
||||
# This helper to exposes a method for caching of view fragments.
|
||||
# See ActionController::Caching::Fragments for usage instructions.
|
||||
#
|
||||
# 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 news topics, static HTML fragments, and so on.
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
require 'active_support/core_ext/object/blank'
|
||||
|
||||
module ActionView
|
||||
# = Action View Capture Helper
|
||||
module Helpers
|
||||
# CaptureHelper exposes methods to let you extract generated markup which
|
||||
# can be used in other parts of a template or layout file.
|
||||
#
|
||||
# It provides a method to capture blocks into variables through capture and
|
||||
# a way to capture a block of markup for use in a layout through content_for.
|
||||
module CaptureHelper
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
module ActionView
|
||||
# = Action View CSRF Helper
|
||||
module Helpers
|
||||
module CsrfHelper
|
||||
# Returns a meta tag with the request forgery protection token for forms to use. Put this in your head.
|
||||
# Returns a meta tag with the cross-site request forgery protection token
|
||||
# for forms to use. Place this in your head.
|
||||
def csrf_meta_tag
|
||||
if protect_against_forgery?
|
||||
%(<meta name="csrf-param" content="#{Rack::Utils.escape_html(request_forgery_protection_token)}"/>\n<meta name="csrf-token" content="#{Rack::Utils.escape_html(form_authenticity_token)}"/>).html_safe
|
||||
|
|
|
@ -4,6 +4,8 @@ require 'active_support/core_ext/hash/slice'
|
|||
|
||||
module ActionView
|
||||
module Helpers
|
||||
# = Action View Date Helpers
|
||||
#
|
||||
# The Date Helper primarily creates select/option tags for different kinds of dates and date elements. All of the
|
||||
# select-type methods share a number of common options that are as follows:
|
||||
#
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
module ActionView
|
||||
# = Action View Debug Helper
|
||||
#
|
||||
# Provides a set of methods for making it easier to debug Rails objects.
|
||||
module Helpers
|
||||
# Provides a set of methods for making it easier to debug Rails objects.
|
||||
module DebugHelper
|
||||
# Returns a YAML representation of +object+ wrapped with <pre> and </pre>.
|
||||
# If the object cannot be converted to YAML using +to_yaml+, +inspect+ will be called instead.
|
||||
|
|
|
@ -7,6 +7,7 @@ require 'active_support/core_ext/hash/slice'
|
|||
require 'active_support/core_ext/object/blank'
|
||||
|
||||
module ActionView
|
||||
# = Action View Form Helpers
|
||||
module Helpers
|
||||
# Form helpers are designed to make working with resources much easier
|
||||
# compared to using vanilla HTML.
|
||||
|
|
|
@ -4,6 +4,7 @@ require 'action_view/helpers/form_helper'
|
|||
require 'active_support/core_ext/object/blank'
|
||||
|
||||
module ActionView
|
||||
# = Action View Form Option Helpers
|
||||
module Helpers
|
||||
# Provides a number of methods for turning different kinds of containers into a set of option tags.
|
||||
# == Options
|
||||
|
|
|
@ -4,6 +4,7 @@ require 'active_support/core_ext/object/returning'
|
|||
require 'active_support/core_ext/object/blank'
|
||||
|
||||
module ActionView
|
||||
# = Action View Form Tag Helpers
|
||||
module Helpers
|
||||
# Provides a number of methods for creating form tags that doesn't rely on an Active Record object assigned to the template like
|
||||
# FormHelper does. Instead, you provide the names and values manually.
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
require 'action_view/helpers/tag_helper'
|
||||
|
||||
module ActionView
|
||||
# = Action View JavaScript Helpers
|
||||
module Helpers
|
||||
# Provides functionality for working with JavaScript in your views.
|
||||
#
|
||||
|
|
|
@ -4,6 +4,7 @@ require 'active_support/core_ext/object/returning'
|
|||
require 'active_support/core_ext/object/blank'
|
||||
|
||||
module ActionView
|
||||
# = Action View Prototype Helpers
|
||||
module Helpers
|
||||
# Prototype[http://www.prototypejs.org/] is a JavaScript library that provides
|
||||
# DOM[http://en.wikipedia.org/wiki/Document_Object_Model] manipulation,
|
||||
|
|
|
@ -1,6 +1,15 @@
|
|||
module ActionView #:nodoc:
|
||||
# = Action View Raw Output Helper
|
||||
module Helpers #:nodoc:
|
||||
module RawOutputHelper
|
||||
# This method outputs without escaping a string. Since escaping tags is
|
||||
# now default, this can be used when you don't want Rails to automatically
|
||||
# escape tags. This is not recommended if the data is coming from the user's
|
||||
# input.
|
||||
#
|
||||
# For example:
|
||||
#
|
||||
# <%=raw @user.name %>
|
||||
def raw(stringish)
|
||||
stringish.to_s.html_safe
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue