Skip to content

Instantly share code, notes, and snippets.

View techpeace's full-sized avatar

Matt Buck techpeace

View GitHub Profile
<h1>New product</h1>
Are you creating a new Product object in this action? Try this:
<%= @product.inspect %>
If nothing shows up, then you need a <pre>Product.new</pre> in this controller action.
<% form_for(@product) do |f| %>
<%= f.error_messages %>
@techpeace
techpeace / gist:180579
Created September 3, 2009 22:24 — forked from mtodd/gist:180398
Surround a heredoc with quotes and you can continue the code on the same line:
render :status => 404, :text => <<-'EOH' and return unless setup
article not found<br/>
I, as a server, have failed<br/>
https?
EOH
Quotes also give you more freedom/creativity with the terminal ID:
Surround a heredoc with quotes and you can continue the code on the same line:
render :status => 404, :text => <<-'EOH' and return unless setup
article not found<br/>
I, as a server, have failed<br/>
https?
EOH