Permalink
Browse files

A few more minor scaffold template cleanups

  • Loading branch information...
1 parent 44f02de commit a2da7fd349b3e8fbeb814a64c9bb6b7c91290257 @dhh dhh committed Feb 5, 2009
@@ -11,7 +11,7 @@
<p style="color: green"><%%= flash[:notice] %></p>
-<%%= yield %>
+<%%= yield %>
</body>
</html>
@@ -10,9 +10,9 @@
</p>
<% end -%>
<p>
- <%%= f.submit "Update" %>
+ <%%= f.submit 'Update' %>
</p>
<%% end %>
<%%= link_to 'Show', @<%= singular_name %> %> |
-<%%= link_to 'Back', <%= plural_name %>_path %>
+<%%= link_to 'Back', <%= plural_name %>_path %>
@@ -21,4 +21,4 @@
<br />
-<%%= link_to 'New <%= singular_name %>', new_<%= singular_name %>_path %>
+<%%= link_to 'New <%= singular_name %>', new_<%= singular_name %>_path %>
@@ -10,8 +10,8 @@
</p>
<% end -%>
<p>
- <%%= f.submit "Create" %>
+ <%%= f.submit 'Create' %>
</p>
<%% end %>
-<%%= link_to 'Back', <%= plural_name %>_path %>
+<%%= link_to 'Back', <%= plural_name %>_path %>
@@ -7,4 +7,4 @@
<% end -%>
<%%= link_to 'Edit', edit_<%= singular_name %>_path(@<%= singular_name %>) %> |
-<%%= link_to 'Back', <%= plural_name %>_path %>
+<%%= link_to 'Back', <%= plural_name %>_path %>

7 comments on commit a2da7fd

seban replied Feb 5, 2009

What is the difference between “Create” and ‘Create’ ?

mjm replied Feb 5, 2009

@seban

‘Create’ won’t check for variable substitutions, so it’s a slight optimization, I believe.

Contributor

thedarkone replied Feb 5, 2009

I don’t think there is a difference in speed between ‘abc’ and “abc” on MRI… however some people prefer to use ‘abc’ when no substitution is expected as a readability hint (as in: ‘This is just a string. No variable substitution magic going in here’).

the MRI is smart enough to do the right thing until it has to:

ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]
puts Benchmark.measure{1000000.times{’A string’}}
0.280000 0.010000 0.290000 ( 0.287780)
puts Benchmark.measure{1000000.times{"A string"}}
0.270000 0.000000 0.270000 ( 0.280098)
puts Benchmark.measure{1000000.times{"A #{} string"}}
1.040000 0.010000 1.050000 ( 1.064335)

Sorry about that:

ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]

puts Benchmark.measure{1000000.times{‘A string’}} 
0.280000 0.010000 0.290000 ( 0.287780) 
puts Benchmark.measure{1000000.times{“A string”}} 
0.270000 0.000000 0.270000 ( 0.280098) 
puts Benchmark.measure{1000000.times{“A #{} string”}} 
1.040000 0.010000 1.050000 ( 1.064335)
Contributor

jrom replied Feb 8, 2009

Maybe a preview button would be nice when commenting to GitHub… (Sorry for the Offtopic)

Using single quotes for optimization purpose is just a good… PHP practice !

Please sign in to comment.