Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- Piece of erb code -->
- <% unless_error do %> # Error: wrong number of arguments (1 for 2)
- <p>Some HTML here</p>
- <% end %>
- # MyHelper.rb:
- def unless_error &block
- if flash[:error]
- concat "<p>#{flash[:error]}</p>"
- else
- # Execute given erb block:
- yield
- end
- end
- # The problem is the error message on line 2.
Add Comment
Please, Sign In to add comment