Skip to content
This repository
Browse code

Fix the indentation on the from template of the scaffold generator

  • Loading branch information...
commit 443a1a262f7a68b4687738fe536554340bc59963 1 parent 4beac29
Rafael Mendonça França authored August 19, 2013
6  railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb
@@ -21,13 +21,13 @@
21 21
     <%%= f.label :password_confirmation %><br>
22 22
     <%%= f.password_field :password_confirmation %>
23 23
 <% else -%>
24  
-  <% if attribute.reference? -%>
  24
+  <%- if attribute.reference? -%>
25 25
     <%%= f.label :<%= attribute.column_name %> %><br>
26 26
     <%%= f.<%= attribute.field_type %> :<%= attribute.column_name %> %>
27  
-  <% else -%>
  27
+  <%- else -%>
28 28
     <%%= f.label :<%= attribute.name %> %><br>
29 29
     <%%= f.<%= attribute.field_type %> :<%= attribute.name %> %>
30  
-  <% end -%>
  30
+  <%- end -%>
31 31
 <% end -%>
32 32
   </div>
33 33
 <% end -%>
4  railties/test/generators/scaffold_generator_test.rb
@@ -305,8 +305,8 @@ def test_scaffold_generator_belongs_to
305 305
     end
306 306
 
307 307
     assert_file "app/views/accounts/_form.html.erb" do |content|
308  
-      assert_match(/<%= f\.text_field :name %>/, content)
309  
-      assert_match(/<%= f\.text_field :currency_id %>/, content)
  308
+      assert_match(/^\W{4}<%= f\.text_field :name %>/, content)
  309
+      assert_match(/^\W{4}<%= f\.text_field :currency_id %>/, content)
310 310
     end
311 311
   end
312 312
 

0 notes on commit 443a1a2

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