Skip to content
Browse files

fixed erb error with case statements

  • Loading branch information...
1 parent 242d8ab commit ad131b15db3c630fcf0b0b7875c02c8fc262066f Russell Norris committed Feb 9, 2009
View
3 generators/skinny_scaffold/templates/form.html_spec.rb
@@ -8,8 +8,7 @@
# :name => "Foo", :address => "815 Oceanic Drive"
<% else -%>
<%- attributes.each_with_index do |attribute, index| -%>
- <%- case attribute.type -%>
- <%- when :string, :text -%>
+ <%- case attribute.type when :string, :text -%>
:<%= attribute.name %> => "foo"<%= index < attributes.size - 1 ? "," : "" %>
<%- when :integer, :float, :decimal -%>
:<%= attribute.name %> => 815<%= index < attributes.size - 1 ? "," : "" %>
View
3 generators/skinny_scaffold/templates/index_partial.html_spec.rb
@@ -8,8 +8,7 @@
# :name => "Foo", :created_at => 1.week.ago, :updated_at => nil
<% else -%>
<%- attributes.each_with_index do |attribute, index| -%>
- <%- case attribute.type -%>
- <%- when :string, :text -%>
+ <%- case attribute.type when :string, :text -%>
:<%= attribute.name %> => "foo"<%= index < attributes.size - 1 ? "," : "" %>
<%- when :integer, :float, :decimal -%>
:<%= attribute.name %> => 815<%= index < attributes.size - 1 ? "," : "" %>
View
3 generators/skinny_scaffold/templates/show.html_spec.rb
@@ -7,8 +7,7 @@
<% else -%>
@<%= singular_name %> = mock_and_assign(<%= model_name %>, :stub => {
<%- attributes.each_with_index do |attribute, index| -%>
- <%- case attribute.type -%>
- <%- when :string, :text -%>
+ <%- case attribute.type when :string, :text -%>
:<%= attribute.name %> => "foo"<%= index < attributes.size - 1 ? "," : "" %>
<%- when :integer, :float, :decimal -%>
:<%= attribute.name %> => 815<%= index < attributes.size - 1 ? "," : "" %>

0 comments on commit ad131b1

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