From 4fb79facedaefd577f62ddf18c13890753bd139e Mon Sep 17 00:00:00 2001 From: Jeroen van Dijk Date: Fri, 12 Mar 2010 13:17:41 +0100 Subject: [PATCH] Updated documentation for block helpers in url_helper.rb --- actionpack/lib/action_view/helpers/url_helper.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb index 148f286..ae1385f 100644 --- a/actionpack/lib/action_view/helpers/url_helper.rb +++ b/actionpack/lib/action_view/helpers/url_helper.rb @@ -162,7 +162,7 @@ module ActionView # # You can use a block as well if your link target is hard to fit into the name parameter. ERb example: # - # <% link_to(@profile) do %> + # <%= link_to(@profile) do %> # <%= @profile.name %> -- Check it out! # <% end %> # # => -- 1.6.0.2 From 1ca8bcf4e833c8efa63f411b683d14c257acb934 Mon Sep 17 00:00:00 2001 From: Jeroen van Dijk Date: Fri, 12 Mar 2010 13:19:59 +0100 Subject: [PATCH] Updated documentation for block helpers in tag_helper.rb --- actionpack/lib/action_view/helpers/tag_helper.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/actionpack/lib/action_view/helpers/tag_helper.rb b/actionpack/lib/action_view/helpers/tag_helper.rb index d9d2588..8ae2e5f 100644 --- a/actionpack/lib/action_view/helpers/tag_helper.rb +++ b/actionpack/lib/action_view/helpers/tag_helper.rb @@ -65,7 +65,7 @@ module ActionView # content_tag("select", options, :multiple => true) # # => # - # <% content_tag :div, :class => "strong" do -%> + # <%= content_tag :div, :class => "strong" do -%> # Hello world! # <% end -%> # # =>
Hello world!
-- 1.6.0.2 From f12f3c6882904576fa29a14df62696fb0f3c122c Mon Sep 17 00:00:00 2001 From: Jeroen van Dijk Date: Fri, 12 Mar 2010 13:21:52 +0100 Subject: [PATCH] Updated documentation for block helpers in record_tag_helper.rb --- .../lib/action_view/helpers/record_tag_helper.rb | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/actionpack/lib/action_view/helpers/record_tag_helper.rb b/actionpack/lib/action_view/helpers/record_tag_helper.rb index 31411dc..a9cf15f 100644 --- a/actionpack/lib/action_view/helpers/record_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/record_tag_helper.rb @@ -4,7 +4,7 @@ module ActionView # Produces a wrapper DIV element with id and class parameters that # relate to the specified Active Record object. Usage example: # - # <% div_for(@person, :class => "foo") do %> + # <%= div_for(@person, :class => "foo") do %> # <%=h @person.name %> # <% end %> # @@ -19,7 +19,7 @@ module ActionView # content_tag_for creates an HTML element with id and class parameters # that relate to the specified Active Record object. For example: # - # <% content_tag_for(:tr, @person) do %> + # <%= content_tag_for(:tr, @person) do %> # <%=h @person.first_name %> # <%=h @person.last_name %> # <% end %> @@ -31,7 +31,7 @@ module ActionView # # If you require the HTML id attribute to have a prefix, you can specify it: # - # <% content_tag_for(:tr, @person, :foo) do %> ... + # <%= content_tag_for(:tr, @person, :foo) do %> ... # # produces: # @@ -41,7 +41,7 @@ module ActionView # additional HTML attributes. If you specify a :class value, it will be combined # with the default class name for your object. For example: # - # <% content_tag_for(:li, @person, :class => "bar") %>... + # <%= content_tag_for(:li, @person, :class => "bar") %>... # # produces: # -- 1.6.0.2 From b3f08802b6f297207c5b0936d3e0d1daa38efa78 Mon Sep 17 00:00:00 2001 From: Jeroen van Dijk Date: Fri, 12 Mar 2010 13:23:24 +0100 Subject: [PATCH] Updated documentation for block helpers in prototype_helper.rb --- .../lib/action_view/helpers/prototype_helper.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/actionpack/lib/action_view/helpers/prototype_helper.rb b/actionpack/lib/action_view/helpers/prototype_helper.rb index be49b5c..4d6ea7d 100644 --- a/actionpack/lib/action_view/helpers/prototype_helper.rb +++ b/actionpack/lib/action_view/helpers/prototype_helper.rb @@ -35,7 +35,7 @@ module ActionView # # ...through a form... # - # <% form_remote_tag :url => '/shipping' do -%> + # <%= form_remote_tag :url => '/shipping' do -%> #
<%= submit_tag 'Recalculate Shipping' %>
# <% end -%> # -- 1.6.0.2 From cd7b382a60454f21e8f536b17ec773e122788bc7 Mon Sep 17 00:00:00 2001 From: Jeroen van Dijk Date: Fri, 12 Mar 2010 13:24:17 +0100 Subject: [PATCH] Updated documentation for block helpers in javascript_helper.rb --- .../lib/action_view/helpers/javascript_helper.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/actionpack/lib/action_view/helpers/javascript_helper.rb b/actionpack/lib/action_view/helpers/javascript_helper.rb index 8dab309..07eee3b 100644 --- a/actionpack/lib/action_view/helpers/javascript_helper.rb +++ b/actionpack/lib/action_view/helpers/javascript_helper.rb @@ -71,7 +71,7 @@ module ActionView # # Instead of passing the content as an argument, you can also use a block # in which case, you pass your +html_options+ as the first parameter. - # <% javascript_tag :defer => 'defer' do -%> + # <%= javascript_tag :defer => 'defer' do -%> # alert('All is good') # <% end -%> def javascript_tag(content_or_options_with_block = nil, html_options = {}, &block) -- 1.6.0.2 From b9b5f259568c0ca6a3160e83e81e9b0fb58653ff Mon Sep 17 00:00:00 2001 From: Jeroen van Dijk Date: Fri, 12 Mar 2010 13:25:56 +0100 Subject: [PATCH] Updated documentation for block helpers in form_tag_helper.rb --- .../lib/action_view/helpers/form_tag_helper.rb | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb index 573733f..07694f5 100644 --- a/actionpack/lib/action_view/helpers/form_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb @@ -37,12 +37,12 @@ module ActionView # form_tag('/upload', :multipart => true) # # =>
# - # <% form_tag('/posts')do -%> + # <%= form_tag('/posts')do -%> #
<%= submit_tag 'Save' %>
# <% end -%> # # =>
# - # <% form_tag('/posts', :remote => true) %> + # <%= form_tag('/posts', :remote => true) %> # # =>
# def form_tag(url_for_options = {}, options = {}, *parameters_for_url, &block) @@ -430,17 +430,17 @@ module ActionView # options accept the same values as tag. # # ==== Examples - # <% field_set_tag do %> + # <%= field_set_tag do %> #

<%= text_field_tag 'name' %>

# <% end %> # # =>

# - # <% field_set_tag 'Your details' do %> + # <%= field_set_tag 'Your details' do %> #

<%= text_field_tag 'name' %>

# <% end %> # # =>
Your details

# - # <% field_set_tag nil, :class => 'format' do %> + # <%= field_set_tag nil, :class => 'format' do %> #

<%= text_field_tag 'name' %>

# <% end %> # # =>

-- 1.6.0.2 From dded03112db5e7a8cfb30bf9496008caa1aacf58 Mon Sep 17 00:00:00 2001 From: Jeroen van Dijk Date: Fri, 12 Mar 2010 13:31:01 +0100 Subject: [PATCH] Updated documentation for block helpers in form_helper.rb --- actionpack/lib/action_view/helpers/form_helper.rb | 64 ++++++++++---------- 1 files changed, 32 insertions(+), 32 deletions(-) diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index 48df26e..5a2370b 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -28,7 +28,7 @@ module ActionView # # # Note: a @person variable will have been created in the controller. # # For example: @person = Person.new - # <% form_for :person, @person, :url => { :action => "create" } do |f| %> + # <%= form_for :person, @person, :url => { :action => "create" } do |f| %> # <%= f.text_field :first_name %> # <%= f.text_field :last_name %> # <%= submit_tag 'Create' %> @@ -44,7 +44,7 @@ module ActionView # # If you are using a partial for your form fields, you can use this shortcut: # - # <% form_for :person, @person, :url => { :action => "create" } do |f| %> + # <%= form_for :person, @person, :url => { :action => "create" } do |f| %> # <%= render :partial => f %> # <%= submit_tag 'Create' %> # <% end %> @@ -102,7 +102,7 @@ module ActionView # Rails provides succinct resource-oriented form generation with +form_for+ # like this: # - # <% form_for @offer do |f| %> + # <%= form_for @offer do |f| %> # <%= f.label :version, 'Version' %>: # <%= f.text_field :version %>
# <%= f.label :author, 'Author' %>: @@ -119,7 +119,7 @@ module ActionView # The generic way to call +form_for+ yields a form builder around a # model: # - # <% form_for :person, :url => { :action => "update" } do |f| %> + # <%= form_for :person, :url => { :action => "update" } do |f| %> # <%= f.error_messages %> # First name: <%= f.text_field :first_name %>
# Last name : <%= f.text_field :last_name %>
@@ -143,7 +143,7 @@ module ActionView # If the instance variable is not @person you can pass the actual # record as the second argument: # - # <% form_for :person, person, :url => { :action => "update" } do |f| %> + # <%= form_for :person, person, :url => { :action => "update" } do |f| %> # ... # <% end %> # @@ -175,7 +175,7 @@ module ActionView # possible to use both the stand-alone FormHelper methods and methods # from FormTagHelper. For example: # - # <% form_for :person, @person, :url => { :action => "update" } do |f| %> + # <%= form_for :person, @person, :url => { :action => "update" } do |f| %> # First name: <%= f.text_field :first_name %> # Last name : <%= f.text_field :last_name %> # Biography : <%= text_area :person, :biography %> @@ -195,37 +195,37 @@ module ActionView # # For example, if @post is an existing record you want to edit # - # <% form_for @post do |f| %> + # <%= form_for @post do |f| %> # ... # <% end %> # # is equivalent to something like: # - # <% form_for :post, @post, :url => post_path(@post), :html => { :method => :put, :class => "edit_post", :id => "edit_post_45" } do |f| %> + # <%= form_for :post, @post, :url => post_path(@post), :html => { :method => :put, :class => "edit_post", :id => "edit_post_45" } do |f| %> # ... # <% end %> # # And for new records # - # <% form_for(Post.new) do |f| %> + # <%= form_for(Post.new) do |f| %> # ... # <% end %> # # expands to # - # <% form_for :post, Post.new, :url => posts_path, :html => { :class => "new_post", :id => "new_post" } do |f| %> + # <%= form_for :post, Post.new, :url => posts_path, :html => { :class => "new_post", :id => "new_post" } do |f| %> # ... # <% end %> # # You can also overwrite the individual conventions, like this: # - # <% form_for(@post, :url => super_post_path(@post)) do |f| %> + # <%= form_for(@post, :url => super_post_path(@post)) do |f| %> # ... # <% end %> # # And for namespaced routes, like +admin_post_url+: # - # <% form_for([:admin, @post]) do |f| %> + # <%= form_for([:admin, @post]) do |f| %> # ... # <% end %> # @@ -243,7 +243,7 @@ module ActionView # # Example: # - # <% form_for(:post, @post, :remote => true, :html => { :id => 'create-post', :method => :put }) do |f| %> + # <%= form_for(:post, @post, :remote => true, :html => { :id => 'create-post', :method => :put }) do |f| %> # ... # <% end %> # @@ -263,7 +263,7 @@ module ActionView # custom builder. For example, let's say you made a helper to # automatically add labels to form inputs. # - # <% form_for :person, @person, :url => { :action => "update" }, :builder => LabellingFormBuilder do |f| %> + # <%= form_for :person, @person, :url => { :action => "update" }, :builder => LabellingFormBuilder do |f| %> # <%= f.text_field :first_name %> # <%= f.text_field :last_name %> # <%= text_area :person, :biography %> @@ -340,11 +340,11 @@ module ActionView # # === Generic Examples # - # <% form_for @person, :url => { :action => "update" } do |person_form| %> + # <%= form_for @person, :url => { :action => "update" } do |person_form| %> # First name: <%= person_form.text_field :first_name %> # Last name : <%= person_form.text_field :last_name %> # - # <% fields_for @person.permission do |permission_fields| %> + # <%= fields_for @person.permission do |permission_fields| %> # Admin? : <%= permission_fields.check_box :admin %> # <% end %> # <% end %> @@ -352,13 +352,13 @@ module ActionView # ...or if you have an object that needs to be represented as a different # parameter, like a Client that acts as a Person: # - # <% fields_for :person, @client do |permission_fields| %> + # <%= fields_for :person, @client do |permission_fields| %> # Admin?: <%= permission_fields.check_box :admin %> # <% end %> # # ...or if you don't have an object, just a name of the parameter: # - # <% fields_for :person do |permission_fields| %> + # <%= fields_for :person do |permission_fields| %> # Admin?: <%= permission_fields.check_box :admin %> # <% end %> # @@ -402,9 +402,9 @@ module ActionView # # This model can now be used with a nested fields_for, like so: # - # <% form_for @person, :url => { :action => "update" } do |person_form| %> + # <%= form_for @person, :url => { :action => "update" } do |person_form| %> # ... - # <% person_form.fields_for :address do |address_fields| %> + # <%= person_form.fields_for :address do |address_fields| %> # Street : <%= address_fields.text_field :street %> # Zip code: <%= address_fields.text_field :zip_code %> # <% end %> @@ -431,9 +431,9 @@ module ActionView # with a value that evaluates to +true+, you will destroy the associated # model (eg. 1, '1', true, or 'true'): # - # <% form_for @person, :url => { :action => "update" } do |person_form| %> + # <%= form_for @person, :url => { :action => "update" } do |person_form| %> # ... - # <% person_form.fields_for :address do |address_fields| %> + # <%= person_form.fields_for :address do |address_fields| %> # ... # Delete: <%= address_fields.check_box :_delete %> # <% end %> @@ -459,9 +459,9 @@ module ActionView # the nested fields_for call will be repeated for each instance in the # collection: # - # <% form_for @person, :url => { :action => "update" } do |person_form| %> + # <%= form_for @person, :url => { :action => "update" } do |person_form| %> # ... - # <% person_form.fields_for :projects do |project_fields| %> + # <%= person_form.fields_for :projects do |project_fields| %> # <% if project_fields.object.active? %> # Name: <%= project_fields.text_field :name %> # <% end %> @@ -470,11 +470,11 @@ module ActionView # # It's also possible to specify the instance to be used: # - # <% form_for @person, :url => { :action => "update" } do |person_form| %> + # <%= form_for @person, :url => { :action => "update" } do |person_form| %> # ... # <% @person.projects.each do |project| %> # <% if project.active? %> - # <% person_form.fields_for :projects, project do |project_fields| %> + # <%= person_form.fields_for :projects, project do |project_fields| %> # Name: <%= project_fields.text_field :name %> # <% end %> # <% end %> @@ -483,9 +483,9 @@ module ActionView # # Or a collection to be used: # - # <% form_for @person, :url => { :action => "update" } do |person_form| %> + # <%= form_for @person, :url => { :action => "update" } do |person_form| %> # ... - # <% person_form.fields_for :projects, @active_projects do |project_fields| %> + # <%= person_form.fields_for :projects, @active_projects do |project_fields| %> # Name: <%= project_fields.text_field :name %> # <% end %> # <% end %> @@ -512,9 +512,9 @@ module ActionView # parameter with a value that evaluates to +true+ # (eg. 1, '1', true, or 'true'): # - # <% form_for @person, :url => { :action => "update" } do |person_form| %> + # <%= form_for @person, :url => { :action => "update" } do |person_form| %> # ... - # <% person_form.fields_for :projects do |project_fields| %> + # <%= person_form.fields_for :projects do |project_fields| %> # Delete: <%= project_fields.check_box :_delete %> # <% end %> # <% end %> @@ -725,7 +725,7 @@ module ActionView # Unfortunately that workaround does not work when the check box goes # within an array-like parameter, as in # - # <% fields_for "project[invoice_attributes][]", invoice, :index => nil do |form| %> + # <%= fields_for "project[invoice_attributes][]", invoice, :index => nil do |form| %> # <%= form.check_box :paid %> # ... # <% end %> @@ -1115,7 +1115,7 @@ module ActionView # Add the submit button for the given form. When no value is given, it checks # if the object is a new resource or not to create the proper label: # - # <% form_for @post do |f| %> + # <%= form_for @post do |f| %> # <%= f.submit %> # <% end %> # -- 1.6.0.2 From ff0bb1c8d8860c354496deb7444c22d6f8f8cf2f Mon Sep 17 00:00:00 2001 From: Jeroen van Dijk Date: Fri, 12 Mar 2010 13:39:30 +0100 Subject: [PATCH] Updated documentation for block helpers in render/partials.rb --- actionpack/lib/action_view/render/partials.rb | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/actionpack/lib/action_view/render/partials.rb b/actionpack/lib/action_view/render/partials.rb index 950c9d2..d34ab03 100644 --- a/actionpack/lib/action_view/render/partials.rb +++ b/actionpack/lib/action_view/render/partials.rb @@ -123,7 +123,7 @@ module ActionView # You can also apply a layout to a block within any template: # # <%# app/views/users/_chief.html.erb &> - # <% render(:layout => "administrator", :locals => { :user => chief }) do %> + # <%= render(:layout => "administrator", :locals => { :user => chief }) do %> # Title: <%= chief.title %> # <% end %> # @@ -146,7 +146,7 @@ module ActionView # # # <%# app/views/users/index.html.erb &> - # <% render :layout => @users do |user| %> + # <%= render :layout => @users do |user| %> # Title: <%= user.title %> # <% end %> # @@ -162,7 +162,7 @@ module ActionView # # # <%# app/views/users/index.html.erb &> - # <% render :layout => @users do |user, section| %> + # <%= render :layout => @users do |user, section| %> # <%- case section when :header -%> # Title: <%= user.title %> # <%- when :footer -%> -- 1.6.0.2 From 0518d67f1c1429ddcea1e6dce4ea21d9dbc39597 Mon Sep 17 00:00:00 2001 From: Jeroen van Dijk Date: Fri, 12 Mar 2010 13:39:47 +0100 Subject: [PATCH] Updated documentation for block helpers in render/layouts.rb --- actionpack/lib/action_view/render/layouts.rb | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/actionpack/lib/action_view/render/layouts.rb b/actionpack/lib/action_view/render/layouts.rb index 8688de3..e9252db 100644 --- a/actionpack/lib/action_view/render/layouts.rb +++ b/actionpack/lib/action_view/render/layouts.rb @@ -13,7 +13,7 @@ module ActionView # ==== Example # # # The template - # <% render :layout => "my_layout" do %>Content<% end %> + # <%= render :layout => "my_layout" do %>Content<% end %> # # # The layout # <% yield %> @@ -27,7 +27,7 @@ module ActionView # ==== Example # # # The template - # <% render :layout => "my_layout" do |customer| %>Hello <%= customer.name %><% end %> + # <%= render :layout => "my_layout" do |customer| %>Hello <%= customer.name %><% end %> # # # The layout # <% yield Struct.new(:name).new("David") %> -- 1.6.0.2