diff --git a/railties/guides/source/action_controller_overview.textile b/railties/guides/source/action_controller_overview.textile index e193c57935..caa7646b7f 100644 --- a/railties/guides/source/action_controller_overview.textile +++ b/railties/guides/source/action_controller_overview.textile @@ -255,12 +255,12 @@ The +destroy+ action redirects to the application's +root_url+, where the messag
- <% if flash[:notice] -%> + <% if flash[:notice] %><%= flash[:notice] %>
- <% end -%> - <% if flash[:error] -%> + <% end %> + <% if flash[:error] %><%= flash[:error] %>
- <% end -%> + <% end %> @@ -494,7 +494,7 @@ If you generate a form like this: <%= form_for @user do |f| %> <%= f.text_field :username %> - <%= f.text_field :password -%> + <%= f.text_field :password %> <% end %> diff --git a/railties/guides/source/action_view_overview.textile b/railties/guides/source/action_view_overview.textile index df8cf4dc29..43ebe87875 100644 --- a/railties/guides/source/action_view_overview.textile +++ b/railties/guides/source/action_view_overview.textile @@ -135,7 +135,7 @@ The +post+ partial wraps the post's +body+ in a +div+ with the +id+ of the post *posts/_post.html.erb* -<% div_for(post) do %> +<%= div_for(post) do %><%= post.body %>
<% end %> @@ -158,7 +158,7 @@ You can also render a block of code within a partial layout instead of calling + <% render(:layout => 'box', :locals => {:post => @post}) do %> - <% div_for(post) do %> + <%= div_for(post) do %><%= post.body %>
<% end %> <% end %> @@ -654,7 +654,7 @@ The core method of this helper, form_for, gives you the ability to create a form # Note: a @person variable will have been created in the controller (e.g. @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' %> @@ -695,7 +695,7 @@ h5. fields_for Creates a scope around a specific model object like form_for, but doesnât create the form tags themselves. This makes fields_for suitable for specifying additional model objects in the same form: -<% 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 %> @@ -719,7 +719,7 @@ h5. form_for Creates a form and a scope around a specific model object that is used as a base for questioning about values for the fields. -<% form_for @post do |f| %> +<%= form_for @post do |f| %> <%= f.label :title, 'Title' %>: <%= f.text_field :title %><%= text_field_tag 'name' %>
<% end %> # => @@ -970,10 +970,10 @@ Creates a file upload field. If you are using file uploads then you will also need to set the multipart option for the form tag: -<%= form_tag { :action => "post" }, { :multipart => true } %> +<%= form_tag { :action => "post" }, { :multipart => true } do %> <%= file_field_tag "file" %> <%= submit_tag %> -<%= end_form_tag %> +<% end %> Example output: @@ -988,9 +988,9 @@ h5. form_tag Starts a form tag that points the action to an url configured with +url_for_options+ just like +ActionController::Base#url_for+. -<% form_tag '/posts' do -%> +<%= form_tag '/posts' do %>
<%= f.label :description %>
diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index 17279146a7..2bbb4dc252 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -974,7 +974,7 @@ Once we have made the new comment, we send the user back to the +post_path(@post
<% end %>
Zone name
<%= f.text_field :name %>
@@ -1181,11 +1181,11 @@ On pages generated by +NewsController+, you want to hide the top menu and add a
<% content_for :stylesheets do %>
#top_menu {display: none}
#right_menu {float: right; background-color: yellow; color: black}
-<% end -%>
+<% end %>
<% content_for :content do %>