Skip to content
This repository
Browse code

Adds title and description where needed.

  • Loading branch information...
commit 5a0bc2c7bc993e8f987a99f510b7d1d2cc7cf8ba 1 parent fde9504
Rizwan Reza rizwanreza authored
10 actionpack/lib/action_view/base.rb
@@ -8,11 +8,13 @@ module ActionView #:nodoc:
8 8 class NonConcattingString < ActiveSupport::SafeBuffer
9 9 end
10 10
  11 + # = Action View Base
  12 + #
11 13 # 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
12 14 # (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.
13 15 # If the template file has a <tt>.rjs</tt> extension then it will use ActionView::Helpers::PrototypeHelper::JavaScriptGenerator.
14 16 #
15   - # = ERb
  17 + # == ERb
16 18 #
17 19 # You trigger ERb by using embeddings such as <% %>, <% -%>, and <%= %>. The <%= %> tag set is used when you want output. Consider the
18 20 # following loop for names:
@@ -32,7 +34,7 @@ class NonConcattingString < ActiveSupport::SafeBuffer
32 34 #
33 35 # <%- and -%> suppress leading and trailing whitespace, including the trailing newline, and can be used interchangeably with <% and %>.
34 36 #
35   - # == Using sub templates
  37 + # === Using sub templates
36 38 #
37 39 # Using sub templates allows you to sidestep tedious replication and extract common display structures in shared templates. The
38 40 # 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 @@ class NonConcattingString < ActiveSupport::SafeBuffer
54 56 #
55 57 # <title><%= @page_title %></title>
56 58 #
57   - # == Passing local variables to sub templates
  59 + # === Passing local variables to sub templates
58 60 #
59 61 # You can pass local variables to sub templates by using a hash with the variable names as keys and the objects as values:
60 62 #
@@ -74,7 +76,7 @@ class NonConcattingString < ActiveSupport::SafeBuffer
74 76 #
75 77 # Testing using <tt>defined? headline</tt> will not work. This is an implementation restriction.
76 78 #
77   - # == Template caching
  79 + # === Template caching
78 80 #
79 81 # By default, Rails will compile each template to a method in order to render it. When you alter a template, Rails will
80 82 # check the file's modification time and recompile it.
21 actionpack/lib/action_view/context.rb
@@ -2,13 +2,12 @@ module ActionView
2 2 module CompiledTemplates #:nodoc:
3 3 # holds compiled template code
4 4 end
5   -
6   - # Action View contexts are supplied to Action Controller
7   - # to render template. The default Action View context
8   - # is ActionView::Base.
  5 + # = Action View Context
  6 + #
  7 + # Action View contexts are supplied to Action Controller to render template.
  8 + # The default Action View context is ActionView::Base.
9 9 #
10   - # In order to work with ActionController, a Context
11   - # must implement:
  10 + # In order to work with ActionController, a Context must implement:
12 11 #
13 12 # Context#render_partial[options]
14 13 # - responsible for setting options[:_template]
@@ -21,16 +20,14 @@ module CompiledTemplates #:nodoc:
21 20 # options<Hash>:: See _render_template_with_layout in ActionView::Base
22 21 # partial<Boolean>:: Whether or not the template to render is a partial
23 22 #
24   - # An Action View context can also mix in Action View's
25   - # helpers. In order to mix in helpers, a context must
26   - # implement:
  23 + # An Action View context can also mix in Action View's helpers. In order to
  24 + # mix in helpers, a context must implement:
27 25 #
28 26 # Context#controller
29 27 # - Returns an instance of AbstractController
30 28 #
31   - # In any case, a context must mix in ActionView::Context,
32   - # which stores compiled template and provides the output
33   - # buffer.
  29 + # In any case, a context must mix in ActionView::Context, which stores compiled
  30 + # template and provides the output buffer.
34 31 module Context
35 32 include CompiledTemplates
36 33 attr_accessor :output_buffer
1  actionpack/lib/action_view/helpers/asset_tag_helper.rb
@@ -6,6 +6,7 @@
6 6 require 'active_support/core_ext/object/blank'
7 7
8 8 module ActionView
  9 + # = Action View Asset Tag Helpers
9 10 module Helpers #:nodoc:
10 11 # This module provides methods for generating HTML that links views to assets such
11 12 # as images, javascripts, stylesheets, and feeds. These methods do not verify
6 actionpack/lib/action_view/helpers/atom_feed_helper.rb
... ... @@ -1,10 +1,12 @@
1 1 require 'set'
2 2
3   -# Adds easy defaults to writing Atom feeds with the Builder template engine (this does not work on ERb or any other
4   -# template languages).
5 3 module ActionView
  4 + # = Action View Atom Feed Helpers
6 5 module Helpers #:nodoc:
7 6 module AtomFeedHelper
  7 + # Adds easy defaults to writing Atom feeds with the Builder template engine (this does not work on ERb or any other
  8 + # template languages).
  9 + #
8 10 # Full usage example:
9 11 #
10 12 # config/routes.rb:
6 actionpack/lib/action_view/helpers/cache_helper.rb
... ... @@ -1,8 +1,10 @@
1 1 module ActionView
  2 + # = Action View Cache Helper
2 3 module Helpers
3   - # This helper to exposes a method for caching of view fragments.
4   - # See ActionController::Caching::Fragments for usage instructions.
5 4 module CacheHelper
  5 + # This helper to exposes a method for caching of view fragments.
  6 + # See ActionController::Caching::Fragments for usage instructions.
  7 + #
6 8 # A method for caching fragments of a view rather than an entire
7 9 # action or page. This technique is useful caching pieces like
8 10 # menus, lists of news topics, static HTML fragments, and so on.
2  actionpack/lib/action_view/helpers/capture_helper.rb
... ... @@ -1,9 +1,11 @@
1 1 require 'active_support/core_ext/object/blank'
2 2
3 3 module ActionView
  4 + # = Action View Capture Helper
4 5 module Helpers
5 6 # CaptureHelper exposes methods to let you extract generated markup which
6 7 # can be used in other parts of a template or layout file.
  8 + #
7 9 # It provides a method to capture blocks into variables through capture and
8 10 # a way to capture a block of markup for use in a layout through content_for.
9 11 module CaptureHelper
4 actionpack/lib/action_view/helpers/csrf_helper.rb
... ... @@ -1,7 +1,9 @@
1 1 module ActionView
  2 + # = Action View CSRF Helper
2 3 module Helpers
3 4 module CsrfHelper
4   - # Returns a meta tag with the request forgery protection token for forms to use. Put this in your head.
  5 + # Returns a meta tag with the cross-site request forgery protection token
  6 + # for forms to use. Place this in your head.
5 7 def csrf_meta_tag
6 8 if protect_against_forgery?
7 9 %(<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
2  actionpack/lib/action_view/helpers/date_helper.rb
@@ -4,6 +4,8 @@
4 4
5 5 module ActionView
6 6 module Helpers
  7 + # = Action View Date Helpers
  8 + #
7 9 # The Date Helper primarily creates select/option tags for different kinds of dates and date elements. All of the
8 10 # select-type methods share a number of common options that are as follows:
9 11 #
4 actionpack/lib/action_view/helpers/debug_helper.rb
... ... @@ -1,6 +1,8 @@
1 1 module ActionView
  2 + # = Action View Debug Helper
  3 + #
  4 + # Provides a set of methods for making it easier to debug Rails objects.
2 5 module Helpers
3   - # Provides a set of methods for making it easier to debug Rails objects.
4 6 module DebugHelper
5 7 # Returns a YAML representation of +object+ wrapped with <pre> and </pre>.
6 8 # If the object cannot be converted to YAML using +to_yaml+, +inspect+ will be called instead.
1  actionpack/lib/action_view/helpers/form_helper.rb
@@ -7,6 +7,7 @@
7 7 require 'active_support/core_ext/object/blank'
8 8
9 9 module ActionView
  10 + # = Action View Form Helpers
10 11 module Helpers
11 12 # Form helpers are designed to make working with resources much easier
12 13 # compared to using vanilla HTML.
1  actionpack/lib/action_view/helpers/form_options_helper.rb
@@ -4,6 +4,7 @@
4 4 require 'active_support/core_ext/object/blank'
5 5
6 6 module ActionView
  7 + # = Action View Form Option Helpers
7 8 module Helpers
8 9 # Provides a number of methods for turning different kinds of containers into a set of option tags.
9 10 # == Options
1  actionpack/lib/action_view/helpers/form_tag_helper.rb
@@ -4,6 +4,7 @@
4 4 require 'active_support/core_ext/object/blank'
5 5
6 6 module ActionView
  7 + # = Action View Form Tag Helpers
7 8 module Helpers
8 9 # Provides a number of methods for creating form tags that doesn't rely on an Active Record object assigned to the template like
9 10 # FormHelper does. Instead, you provide the names and values manually.
1  actionpack/lib/action_view/helpers/javascript_helper.rb
... ... @@ -1,6 +1,7 @@
1 1 require 'action_view/helpers/tag_helper'
2 2
3 3 module ActionView
  4 + # = Action View JavaScript Helpers
4 5 module Helpers
5 6 # Provides functionality for working with JavaScript in your views.
6 7 #
1  actionpack/lib/action_view/helpers/prototype_helper.rb
@@ -4,6 +4,7 @@
4 4 require 'active_support/core_ext/object/blank'
5 5
6 6 module ActionView
  7 + # = Action View Prototype Helpers
7 8 module Helpers
8 9 # Prototype[http://www.prototypejs.org/] is a JavaScript library that provides
9 10 # DOM[http://en.wikipedia.org/wiki/Document_Object_Model] manipulation,
9 actionpack/lib/action_view/helpers/raw_output_helper.rb
... ... @@ -1,6 +1,15 @@
1 1 module ActionView #:nodoc:
  2 + # = Action View Raw Output Helper
2 3 module Helpers #:nodoc:
3 4 module RawOutputHelper
  5 + # This method outputs without escaping a string. Since escaping tags is
  6 + # now default, this can be used when you don't want Rails to automatically
  7 + # escape tags. This is not recommended if the data is coming from the user's
  8 + # input.
  9 + #
  10 + # For example:
  11 + #
  12 + # <%=raw @user.name %>
4 13 def raw(stringish)
5 14 stringish.to_s.html_safe
6 15 end

0 comments on commit 5a0bc2c

Please sign in to comment.
Something went wrong with that request. Please try again.